From e9747d440aef9a43b8b8c904baee6952f0b17b84 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:11:08 +0900 Subject: [PATCH 001/147] =?UTF-8?q?array::back,=20front=20:=20LWG=20Issue?= =?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/array/array/back.md | 2 ++ reference/array/array/front.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/reference/array/array/back.md b/reference/array/array/back.md index 669181bfc1..bad51c537b 100644 --- a/reference/array/array/back.md +++ b/reference/array/array/back.md @@ -72,5 +72,7 @@ int main() ## 参照 - [N3470 Constexpr Library Additions: containers, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3470.html) - [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) +- [LWG Issue 1417. `front`/`back` on a zero-sized array should be undefined](https://cplusplus.github.io/LWG/issue1417) + - C++11で、長さ0の配列に対して呼び出したときの動作が、処理系定義から未定義動作へ改められた - [LWG Issue 4276. `front()` and `back()` are not hardened for zero-length `std::array`](https://cplusplus.github.io/LWG/issue4276) - C++26で、[array.zero]の「長さ0の配列で`front()`/`back()`を呼び出したときの動作は未定義」という特別規定が削除され、他の要素アクセス関数と同様に堅牢化された事前条件の対象となった diff --git a/reference/array/array/front.md b/reference/array/array/front.md index 6d5930afa6..90a69d03a9 100644 --- a/reference/array/array/front.md +++ b/reference/array/array/front.md @@ -76,5 +76,7 @@ int main() ## 参照 - [N3470 Constexpr Library Additions: containers, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3470.html) - [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) +- [LWG Issue 1417. `front`/`back` on a zero-sized array should be undefined](https://cplusplus.github.io/LWG/issue1417) + - C++11で、長さ0の配列に対して呼び出したときの動作が、処理系定義から未定義動作へ改められた - [LWG Issue 4276. `front()` and `back()` are not hardened for zero-length `std::array`](https://cplusplus.github.io/LWG/issue4276) - C++26で、[array.zero]の「長さ0の配列で`front()`/`back()`を呼び出したときの動作は未定義」という特別規定が削除され、他の要素アクセス関数と同様に堅牢化された事前条件の対象となった From 7f1f1a08180d90bc1cb9150bc8b1f1076fbf5272 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:11:58 +0900 Subject: [PATCH 002/147] =?UTF-8?q?array=20:=20LWG=20Issue=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/array/array.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/array/array.md b/reference/array/array.md index 6daca45679..530c1db41b 100644 --- a/reference/array/array.md +++ b/reference/array/array.md @@ -177,7 +177,9 @@ int main() ## 参照 -- [LWG Issue 2590. Aggregate initialization for `std::array`](https://cplusplus.github.io/LWG/issue2590) - - C++17で、`array`がコピーリスト初期化に限らず集成体初期化一般で初期化できることが明確化された(`std::array a{0};`のような直接波カッコ初期化も適格) +- [LWG Issue 1306. pointer and `const_pointer` for ``](https://cplusplus.github.io/LWG/issue1306) + - C++11で、メンバ型`pointer`と`const_pointer`が追加された。ほかのコンテナには定義されていたが、記載が漏れていた - [LWG Issue 2310. Public exposition only member in `std::array`](https://cplusplus.github.io/LWG/issue2310) - C++17で、`array`が集成体であることを示す説明専用メンバ(`elems`)がpublicである旨が明確化され、`data()`の規定が`addressof(front())`を用いる形に整理された +- [LWG Issue 2590. Aggregate initialization for `std::array`](https://cplusplus.github.io/LWG/issue2590) + - C++17で、`array`がコピーリスト初期化に限らず集成体初期化一般で初期化できることが明確化された(`std::array a{0};`のような直接波カッコ初期化も適格) From bfaee2b026087163d8c8d5a51ff2c7801a97a4fb Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:12:30 +0900 Subject: [PATCH 003/147] =?UTF-8?q?atomic=E3=82=AF=E3=83=A9=E3=82=B9?= =?UTF-8?q?=E3=81=AEcompare=5Fexchange=20:=20LWG=20Issue=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/atomic/atomic/compare_exchange_strong.md | 2 ++ reference/atomic/atomic/compare_exchange_weak.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/reference/atomic/atomic/compare_exchange_strong.md b/reference/atomic/atomic/compare_exchange_strong.md index f1beed8cb2..d209a3afca 100644 --- a/reference/atomic/atomic/compare_exchange_strong.md +++ b/reference/atomic/atomic/compare_exchange_strong.md @@ -199,3 +199,5 @@ true - C++20での、`volatile`版への制約追加 - [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) - C++26で`constexpr`に対応した +- [LWG Issue 1474. weak compare-and-exchange confusion](https://cplusplus.github.io/LWG/issue1474) + - C++11で、見かけ上の失敗が起こりうるのが弱い版に限られることと、その場合に`expected`が更新されないことが明確化された diff --git a/reference/atomic/atomic/compare_exchange_weak.md b/reference/atomic/atomic/compare_exchange_weak.md index 6ae981e4d9..57c70ac926 100644 --- a/reference/atomic/atomic/compare_exchange_weak.md +++ b/reference/atomic/atomic/compare_exchange_weak.md @@ -224,3 +224,5 @@ 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`に対応した +- [LWG Issue 1474. weak compare-and-exchange confusion](https://cplusplus.github.io/LWG/issue1474) + - C++11で、見かけ上の失敗が起こりうるのが弱い版に限られることと、その場合に`expected`が更新されないことが明確化された From 791d2a246d426ec0621e4e611b8ef2f79e88edc8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:12:50 +0900 Subject: [PATCH 004/147] =?UTF-8?q?atomc=E3=82=AF=E3=83=A9=E3=82=B9?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF?= =?UTF-8?q?=E3=82=BF=20:=20LWG=20Issue=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/atomic/atomic/op_constructor.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/atomic/atomic/op_constructor.md b/reference/atomic/atomic/op_constructor.md index cf5dee4283..25c7427887 100644 --- a/reference/atomic/atomic/op_constructor.md +++ b/reference/atomic/atomic/op_constructor.md @@ -87,5 +87,7 @@ int main() ## 参照 - [P0883R2 Fixing Atomic Initialization, Rev2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0883r2.pdf) +- [LWG Issue 1478. Clarify race conditions in atomics initialization](https://cplusplus.github.io/LWG/issue1478) + - C++11で、初期化がアトミック操作ではないことが規定された。構築中のオブジェクトに対する他スレッドからのアクセスはデータ競合となる - [LWG Issue 4169. `std::atomic`'s default constructor should be constrained](https://cplusplus.github.io/LWG/issue4169) - C++26で、デフォルトコンストラクタの`is_default_constructible_v`要件が適格要件(Mandates)からテンプレートパラメータ制約(Constraints)に変更され、SFINAEフレンドリに振る舞うようになった From fe21e63c5d7c92dae7c5464a453c2649a66d7bf9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:13:18 +0900 Subject: [PATCH 005/147] =?UTF-8?q?atomic=5Fsignal=5Ffence=20:=20LWG=20Iss?= =?UTF-8?q?ue=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/atomic/atomic_signal_fence.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/atomic/atomic_signal_fence.md b/reference/atomic/atomic_signal_fence.md index 00974d700c..368604c808 100644 --- a/reference/atomic/atomic_signal_fence.md +++ b/reference/atomic/atomic_signal_fence.md @@ -58,3 +58,5 @@ namespace std { - [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`に対応した +- [LWG Issue 1480. Atomic fences don't have synchronizes with relation](https://cplusplus.github.io/LWG/issue1480) + - C++11で、この関数が確立するものが「に対して同期する関係」ではなく「順序付けの制約」であると修正された。同一スレッド内のシグナルハンドラとの間では、スレッド間の同期関係は生じないため From f62440b824ac7b68d2f55670806e4dbfe5cb6b22 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:14:28 +0900 Subject: [PATCH 006/147] =?UTF-8?q?bitset=20:=20LWG=20Issue=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/bitset/bitset/op_at.md | 2 ++ reference/bitset/bitset/op_constructor.md | 2 ++ reference/bitset/bitset/test.md | 2 ++ 3 files changed, 6 insertions(+) diff --git a/reference/bitset/bitset/op_at.md b/reference/bitset/bitset/op_at.md index 667e53ae1e..3ef14dc3b4 100644 --- a/reference/bitset/bitset/op_at.md +++ b/reference/bitset/bitset/op_at.md @@ -61,3 +61,5 @@ false - [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) +- [LWG Issue 907. Bitset's immutable element retrieval is inconsistently defined](https://cplusplus.github.io/LWG/issue907) + - C++11で、`const`版の戻り値の規定が[`test(pos)`](test.md)という自己参照から「`pos`番目のビットが1なら`true`」という直接の記述へ改められた。`test()`は例外を送出しうるため、`constexpr`であるこの演算子を`test()`で定義することはできなかった diff --git a/reference/bitset/bitset/op_constructor.md b/reference/bitset/bitset/op_constructor.md index 20244684c0..1832d18015 100644 --- a/reference/bitset/bitset/op_constructor.md +++ b/reference/bitset/bitset/op_constructor.md @@ -170,5 +170,7 @@ 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`を受け取るコンストラクタが追加された +- [LWG Issue 1325. `bitset`](https://cplusplus.github.io/LWG/issue1325) + - C++11で、`const char*`から構築するコンストラクタが、任意の文字型を扱えるテンプレートへ改められ、文字数と`0`/`1`を表す文字を指定できるようになった - [LWG Issue 4294. `bitset(const CharT*)` constructor needs to be constrained](https://cplusplus.github.io/LWG/issue4294) - C++26で、(5)の`const CharT*`をとるコンストラクタに、`CharT`が文字型に相当することを表すテンプレートパラメータ制約(`is_array_v`が`false`、`is_trivially_copyable_v`/`is_standard_layout_v`/`is_trivially_default_constructible_v`が`true`)が追加された。`CharT`が推論されるために不適当な型でもオーバーロード解決に参加してしまう問題を防ぐもの diff --git a/reference/bitset/bitset/test.md b/reference/bitset/bitset/test.md index 63111b23f3..8d156d5a1b 100644 --- a/reference/bitset/bitset/test.md +++ b/reference/bitset/bitset/test.md @@ -49,3 +49,5 @@ int main() ## 参照 - [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) +- [LWG Issue 907. Bitset's immutable element retrieval is inconsistently defined](https://cplusplus.github.io/LWG/issue907) + - C++11で、この関数に付けられていた`constexpr`が取り消された。この関数は範囲外の`pos`に対して例外を送出するため、当時の`constexpr`関数の要件を満たせなかった From 47c4a64dfa1b6c7bc5b412642cbfde55ea55a1da Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:15:03 +0900 Subject: [PATCH 007/147] =?UTF-8?q?duration=20:=20LWG=20Issue=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/duration.md | 2 ++ reference/chrono/duration/op_constructor.md | 4 ++++ reference/chrono/duration/op_divide.md | 4 +++- reference/chrono/duration/op_modulo.md | 4 ++++ reference/chrono/duration/op_modulo_assign.md | 2 ++ reference/chrono/duration/op_multiply.md | 2 ++ 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/reference/chrono/duration.md b/reference/chrono/duration.md index 0af6778f2b..2933a3359a 100644 --- a/reference/chrono/duration.md +++ b/reference/chrono/duration.md @@ -233,5 +233,7 @@ Tue Oct 16 16:25:11 2012 ## 参照 - [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) - C++26でハッシュサポートが追加された +- [LWG Issue 1171. `duration` types should be literal](https://cplusplus.github.io/LWG/issue1171) + - C++11で、コンストラクタ・算術演算子・比較演算子・[`duration_cast`](duration_cast.md)に`constexpr`が付加され、このクラスがリテラル型となった。定数式で時間の計算を行えるようにするため - [LWG Issue 4481. Disallow `chrono::duration`](https://cplusplus.github.io/LWG/issue4481) - C++26で、テンプレートパラメータ`Rep`にCV修飾された型を指定した場合に不適格となることが規定された。CV修飾された`Rep`はメンバ演算子・ハッシュ・汎用の算術コードで問題を起こすため、`const`は`Rep`ではなく`duration`オブジェクト自体に付けるべきである diff --git a/reference/chrono/duration/op_constructor.md b/reference/chrono/duration/op_constructor.md index 745fc0236b..2f32140eea 100644 --- a/reference/chrono/duration/op_constructor.md +++ b/reference/chrono/duration/op_constructor.md @@ -85,6 +85,10 @@ d5 : 3000 ## 参照 - [`std::chrono::duration` construction - ISO C++ Standard - Discussion](https://groups.google.com/a/isocpp.org/forum/#!topic/std-discussion/OcGX7Yj3meI) - [P2117R0 C++ Standard Library Issues Resolved Directly In Prague](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2117r0.html) +- [LWG Issue 974. `duration` should not implicitly convert to `duration`](https://cplusplus.github.io/LWG/issue974) + - C++11で、変換コンストラクタの要件に「変換元の`Rep2`が浮動小数点数型として扱われないこと」が追加された。浮動小数点数の`duration`から整数の`duration`へ暗黙変換すると、意図しない切り捨てが起きるため +- [LWG Issue 1177. Improve "diagnostic required" wording](https://cplusplus.github.io/LWG/issue1177) + - C++11で、値から変換するコンストラクタと、ほかの`duration`から変換するコンストラクタの要件が、オーバーロード解決に参加する条件へ改められた - [LWG Issue 2094. `duration` conversion overflow shouldn't participate in overload resolution](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2094) - [LWG Issue 3090. What is §[time.duration.cons]p4's "no overflow is induced in the conversion" intended to mean?](https://cplusplus.github.io/LWG/issue3090) - (3)のテンプレートパラメータ制約から意味の不明確だった「変換でオーバーフローが生じないこと」という表現が削除され、代わりに`is_convertible_v`が`true`であることと`ratio_divide`が有効な`ratio`の特殊化であることが明示された。この整理はC++26で規定されたが、実装は元々この意図どおりに制約していたため挙動は変わらない diff --git a/reference/chrono/duration/op_divide.md b/reference/chrono/duration/op_divide.md index 15ffa95b3d..cba6effcd8 100644 --- a/reference/chrono/duration/op_divide.md +++ b/reference/chrono/duration/op_divide.md @@ -101,5 +101,7 @@ int main() ## 参照 -- [LWG Issue 3104. Fixing `duration` division](https://wg21.cmeerw.net/lwg/issue3104) +- [LWG Issue 1271. CR undefined in `duration` operators](https://cplusplus.github.io/LWG/issue1271) + - C++11で、戻り値の記述で使用していた`CR`が、引数の型を明示した`CR(Rep1, Rep2)`という表記へ修正された - [P2117R0 C++ Standard Library Issues Resolved Directly In Prague](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2117r0.html) +- [LWG Issue 3104. Fixing `duration` division](https://wg21.cmeerw.net/lwg/issue3104) diff --git a/reference/chrono/duration/op_modulo.md b/reference/chrono/duration/op_modulo.md index 090f6f3e47..ab2fd9aed7 100644 --- a/reference/chrono/duration/op_modulo.md +++ b/reference/chrono/duration/op_modulo.md @@ -100,3 +100,7 @@ int main() ## 参照 - [P2117R0 C++ Standard Library Issues Resolved Directly In Prague](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2117r0.html) +- [LWG Issue 934. `duration` is missing `operator%`](https://cplusplus.github.io/LWG/issue934) + - C++11で、剰余演算子が追加された。時間を単位ごとに分解する (秒数から分と秒を求めるなど) 用途で必要となるため +- [LWG Issue 1271. CR undefined in `duration` operators](https://cplusplus.github.io/LWG/issue1271) + - C++11で、戻り値の記述で使用していた`CR`が、引数の型を明示した`CR(Rep1, Rep2)`という表記へ修正された diff --git a/reference/chrono/duration/op_modulo_assign.md b/reference/chrono/duration/op_modulo_assign.md index cdcff461f7..3a7e9648fe 100644 --- a/reference/chrono/duration/op_modulo_assign.md +++ b/reference/chrono/duration/op_modulo_assign.md @@ -68,3 +68,5 @@ int main() ## 参照 - [P0505R0 Wording for GB 50](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0505r0.html) +- [LWG Issue 934. `duration` is missing `operator%`](https://cplusplus.github.io/LWG/issue934) + - C++11で、剰余演算子が追加された。時間を単位ごとに分解する (秒数から分と秒を求めるなど) 用途で必要となるため diff --git a/reference/chrono/duration/op_multiply.md b/reference/chrono/duration/op_multiply.md index 345dc27ddd..53bf5c1622 100644 --- a/reference/chrono/duration/op_multiply.md +++ b/reference/chrono/duration/op_multiply.md @@ -86,3 +86,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) +- [LWG Issue 2004. `duration::operator*` has template parameters in funny order](https://cplusplus.github.io/LWG/issue2004) + - C++11で、スカラーを左辺にとるオーバーロードのテンプレートパラメータの並び順が`Rep1, Period, Rep2`から`Rep1, Rep2, Period`へ修正された。宣言で使用している順序と一致していなかった From afbd827fc143690464d4813b0d1b5f24f60b2b41 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:15:44 +0900 Subject: [PATCH 008/147] =?UTF-8?q?system=5Fclock=E3=81=AE=E5=A4=89?= =?UTF-8?q?=E6=8F=9B=E9=96=A2=E6=95=B0=20:=20=E4=B8=B8=E3=82=81=E3=82=8B?= =?UTF-8?q?=E3=81=8B=E5=88=87=E3=82=8A=E6=8D=A8=E3=81=A6=E3=82=89=E3=82=8C?= =?UTF-8?q?=E3=82=8B=E3=81=8B=E3=81=AF=E5=87=A6=E7=90=86=E7=B3=BB=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=E3=81=A7=E3=81=82=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C?= =?UTF-8?q?=E6=98=8E=E8=A8=98=E3=81=95=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/system_clock/from_time_t.md | 7 ++++++- reference/chrono/system_clock/to_time_t.md | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/reference/chrono/system_clock/from_time_t.md b/reference/chrono/system_clock/from_time_t.md index 474ace58b5..5e1e203692 100644 --- a/reference/chrono/system_clock/from_time_t.md +++ b/reference/chrono/system_clock/from_time_t.md @@ -18,7 +18,7 @@ static time_point from_time_t(time_t t) noexcept; ## 戻り値 パラメータtと同じ時間を指す[`time_point`](/reference/chrono/time_point.md)を返す。 -[`time_t`](/reference/ctime/time_t.md)の分解能が[`time_point`](/reference/chrono/time_point.md)よりも高い場合は、[`time_point`](/reference/chrono/time_point.md)の分解能に切り捨てられる。 +[`time_t`](/reference/ctime/time_t.md)の分解能が[`time_point`](/reference/chrono/time_point.md)よりも高い場合は、[`time_point`](/reference/chrono/time_point.md)の分解能に制限される。丸めるか切り捨てるかは処理系定義である。 ## 例外 @@ -62,3 +62,8 @@ Tue Sep 27 14:21:13 2011 ### 処理系 - [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] + + +## 参照 +- [LWG Issue 957. Various threading bugs #7](https://cplusplus.github.io/LWG/issue957) + - C++11で、精度が異なる場合に値を丸めるか切り捨てるかは処理系定義であることが明記された diff --git a/reference/chrono/system_clock/to_time_t.md b/reference/chrono/system_clock/to_time_t.md index f2f0968cb0..1c5459a701 100644 --- a/reference/chrono/system_clock/to_time_t.md +++ b/reference/chrono/system_clock/to_time_t.md @@ -18,7 +18,7 @@ static time_t to_time_t(const time_point& t) noexcept; ## 戻り値 パラメータ`t`と同じ時間を指す[`time_t`](/reference/ctime/time_t.md)を返す。 -[`time_point`](/reference/chrono/time_point.md)の分解能が[`time_t`](/reference/ctime/time_t.md)よりも高い場合は、[`time_t`](/reference/ctime/time_t.md)の分解能に切り捨てられる。 +[`time_point`](/reference/chrono/time_point.md)の分解能が[`time_t`](/reference/ctime/time_t.md)よりも高い場合は、[`time_t`](/reference/ctime/time_t.md)の分解能に制限される。丸めるか切り捨てるかは処理系定義である。 ## 例外 @@ -58,3 +58,8 @@ Tue Sep 27 14:21:13 2011 ### 処理系 - [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] + + +## 参照 +- [LWG Issue 957. Various threading bugs #7](https://cplusplus.github.io/LWG/issue957) + - C++11で、精度が異なる場合に値を丸めるか切り捨てるかは処理系定義であることが明記された From 9cffc04a590dc17c03b47dd4c2c986885e1cd67e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:16:09 +0900 Subject: [PATCH 009/147] =?UTF-8?q?steady=5Fclock=20:=20LWG=20Issue?= =?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/chrono/steady_clock.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/chrono/steady_clock.md b/reference/chrono/steady_clock.md index 8c9c9f0575..3e8de05afd 100644 --- a/reference/chrono/steady_clock.md +++ b/reference/chrono/steady_clock.md @@ -93,3 +93,5 @@ int main() ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) +- [LWG Issue 990. `monotonic_clock::is_monotonic` must be true](https://cplusplus.github.io/LWG/issue990) + - C++11で、このクロックが[`system_clock`](system_clock.md)の別名となってよいのは、`system_clock`が単調である場合に限られると規定された。なおC++11の策定中に、このクラスは`monotonic_clock`から`steady_clock`へ改称された From 51f4d673fdf4100a4a1a69b237c3783115ce9367 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:17:30 +0900 Subject: [PATCH 010/147] =?UTF-8?q?treat=5Fas=5Ffloating=5Fpoint=20:=20?= =?UTF-8?q?=E6=9A=97=E9=BB=99=E5=A4=89=E6=8F=9B=E3=81=AE=E8=A8=B1=E5=8F=AF?= =?UTF-8?q?=E3=82=92=E6=84=8F=E5=91=B3=E3=81=99=E3=82=8B=E3=81=93=E3=81=A8?= =?UTF-8?q?=E3=81=8C=E6=98=8E=E7=A2=BA=E5=8C=96=E3=81=95=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/treat_as_floating_point.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reference/chrono/treat_as_floating_point.md b/reference/chrono/treat_as_floating_point.md index f0823db47f..93f5b46bcc 100644 --- a/reference/chrono/treat_as_floating_point.md +++ b/reference/chrono/treat_as_floating_point.md @@ -21,7 +21,9 @@ namespace chrono { ## 概要 `treat_as_floating_point`は、テンプレートパラメータ`Rep`が浮動小数点型かを判定する型特性である。 -[`duration`](/reference/chrono/duration.md)クラスにおいて、他の[`duration`](/reference/chrono/duration.md)の型から変換可能な型かどうかを判定するために使用される。`treat_as_floating_point::value == true`の場合に、変換可能である。 +[`duration`](/reference/chrono/duration.md)クラスにおいて、他の[`duration`](/reference/chrono/duration.md)の型から変換可能な型かどうかを判定するために使用される。`treat_as_floating_point::value == true`の場合に、`duration`間の暗黙変換が許可される。そうでない場合、暗黙変換できるかは各`duration`の周期に依存する。 + +この型特性は、型が浮動小数点数型のように振る舞うか、すなわち値同士の除算において許容できる精度の損失で済むかを示すことを意図している。 ## 例 @@ -64,3 +66,5 @@ int main() ## 参照 - [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) +- [LWG Issue 951. Various threading bugs #1](https://cplusplus.github.io/LWG/issue951) + - C++11で、`value`が`true`であることが「`Rep`が浮動小数点数型である」ことを意味するのではなく、`duration`間の暗黙変換を許可することを意味すると明確化された。あわせて、この型特性の意図を述べる注記が追加された From d4a0343cbfb373a9455e22ea8b49b2824db4b366 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:18:05 +0900 Subject: [PATCH 011/147] =?UTF-8?q?algorithm=20:=20LWG=20Issue=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/algorithm/all_of.md | 2 ++ reference/algorithm/any_of.md | 2 ++ reference/algorithm/copy_backward.md | 2 ++ reference/algorithm/find_end.md | 4 +++- reference/algorithm/find_first_of.md | 2 ++ reference/algorithm/for_each.md | 2 ++ reference/algorithm/is_partitioned.md | 2 ++ reference/algorithm/is_permutation.md | 2 ++ reference/algorithm/merge.md | 2 ++ reference/algorithm/move_backward.md | 2 ++ reference/algorithm/none_of.md | 2 ++ reference/algorithm/partition.md | 4 +++- reference/algorithm/search.md | 10 +++++++--- reference/algorithm/shuffle.md | 6 ++++-- reference/algorithm/unique_copy.md | 2 ++ 15 files changed, 39 insertions(+), 7 deletions(-) diff --git a/reference/algorithm/all_of.md b/reference/algorithm/all_of.md index 3479a06d50..d979dc9644 100644 --- a/reference/algorithm/all_of.md +++ b/reference/algorithm/all_of.md @@ -96,3 +96,5 @@ bool all_of(InputIterator first, InputIterator last, Predicate pred) { - [N2666 More STL algorithms (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2666.pdf) - [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) +- [LWG Issue 1205. Some algorithms could more clearly document their handling of empty ranges](https://cplusplus.github.io/LWG/issue1205) + - C++11で、空のイテレータ範囲を渡した場合の戻り値が明記された diff --git a/reference/algorithm/any_of.md b/reference/algorithm/any_of.md index a0f9beeff9..2e0f700eba 100644 --- a/reference/algorithm/any_of.md +++ b/reference/algorithm/any_of.md @@ -97,3 +97,5 @@ bool any_of(InputIterator first, InputIterator last, Predicate pred) { - [N2666 More STL algorithms (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2666.pdf) - [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) +- [LWG Issue 1205. Some algorithms could more clearly document their handling of empty ranges](https://cplusplus.github.io/LWG/issue1205) + - C++11で、空のイテレータ範囲を渡した場合の戻り値が明記された diff --git a/reference/algorithm/copy_backward.md b/reference/algorithm/copy_backward.md index 6f0521ae43..8cdb6484af 100644 --- a/reference/algorithm/copy_backward.md +++ b/reference/algorithm/copy_backward.md @@ -101,3 +101,5 @@ BidirectionalIterator2 copy_backward(BidirectionalIterator1 first, ## 参照 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) +- [LWG Issue 1206. Incorrect requires for `move_backward` and `copy_backward`](https://cplusplus.github.io/LWG/issue1206) + - C++11で、`result`が含まれてはならない範囲が`[first, last)`から`(first, last]`に修正された。後方へコピーする場合に上書きされうるのは`last`までであり、`first`は上書きされないため diff --git a/reference/algorithm/find_end.md b/reference/algorithm/find_end.md index d5f193db40..d73f13e5fc 100644 --- a/reference/algorithm/find_end.md +++ b/reference/algorithm/find_end.md @@ -141,5 +141,7 @@ ForwardIterator1 find_end(ForwardIterator1 first1, ForwardIterator1 last1, ## 参照 -- [LWG Issue 2150. Unclear specification of `find_end`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2150) +- [LWG Issue 1205. Some algorithms could more clearly document their handling of empty ranges](https://cplusplus.github.io/LWG/issue1205) + - C++11で、空のイテレータ範囲を渡した場合の戻り値が明記された - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) +- [LWG Issue 2150. Unclear specification of `find_end`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2150) diff --git a/reference/algorithm/find_first_of.md b/reference/algorithm/find_first_of.md index d4b3936fe7..b520a9438c 100644 --- a/reference/algorithm/find_first_of.md +++ b/reference/algorithm/find_first_of.md @@ -145,3 +145,5 @@ InputIterator find_first_of(InputIterator first1, InputIterator last1, - C++11から、パラメータのイテレータ型に対する制約が緩和され、`ForwardIterator`から`InputIterator`に変更になった経緯のレポート - [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) +- [LWG Issue 1205. Some algorithms could more clearly document their handling of empty ranges](https://cplusplus.github.io/LWG/issue1205) + - C++11で、空のイテレータ範囲を渡した場合の戻り値が明記された diff --git a/reference/algorithm/for_each.md b/reference/algorithm/for_each.md index 5f846565bd..c99bfb5df2 100644 --- a/reference/algorithm/for_each.md +++ b/reference/algorithm/for_each.md @@ -164,3 +164,5 @@ Function for_each(InputIterator first, InputIterator last, Function f) { ## 参照 - [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) +- [LWG Issue 1110. Is `for_each` overconstrained?](https://cplusplus.github.io/LWG/issue1110) + - C++11で、`Function`に対する要件がコピー構築可能からムーブ構築可能へ緩和され、戻り値が`std::move(f)`と規定された diff --git a/reference/algorithm/is_partitioned.md b/reference/algorithm/is_partitioned.md index 81e3317247..c5eaac2692 100644 --- a/reference/algorithm/is_partitioned.md +++ b/reference/algorithm/is_partitioned.md @@ -119,3 +119,5 @@ bool is_partitioned(InputIterator first, InputIterator last, Predicate pred) - [N2666 More STL algorithms (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2666.pdf) - [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) +- [LWG Issue 1205. Some algorithms could more clearly document their handling of empty ranges](https://cplusplus.github.io/LWG/issue1205) + - C++11で、空のイテレータ範囲を渡した場合の戻り値が明記された diff --git a/reference/algorithm/is_permutation.md b/reference/algorithm/is_permutation.md index aac5049d10..bf5fc7bb33 100644 --- a/reference/algorithm/is_permutation.md +++ b/reference/algorithm/is_permutation.md @@ -231,3 +231,5 @@ bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, - [N3671 Making non-modifying sequence operations more robust: Revision 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3671.html) - C++14から追加された、`last2`を受け取るオーバーロードの提案文書 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) +- [LWG Issue 1431. `is_permutation` must be more restrictive](https://cplusplus.github.io/LWG/issue1431) + - C++11で、2つのイテレータ範囲の値型が同じであり、比較関数が同値関係であることが要件に追加された。それ以外の場合は仕様として意味が定まらないため diff --git a/reference/algorithm/merge.md b/reference/algorithm/merge.md index 4ed8b52c2a..ab502dff3a 100644 --- a/reference/algorithm/merge.md +++ b/reference/algorithm/merge.md @@ -182,3 +182,5 @@ OutputIterator merge(InputIterator1 first1, InputIterator1 last1, - [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) - [P0467R2 Iterator Concerns for Parallel Algorithms](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0467r2.html) +- [LWG Issue 780. `std::merge()` specification incorrect/insufficient](https://cplusplus.github.io/LWG/issue780) + - C++11で、効果が「2つの範囲をマージする」という記述から、「全要素をコピーし、結果がソート済みになるようにする」という具体的な記述へ改められ、入力範囲がソート済みであることが事前条件として明記された diff --git a/reference/algorithm/move_backward.md b/reference/algorithm/move_backward.md index b761f32b2a..0194472091 100644 --- a/reference/algorithm/move_backward.md +++ b/reference/algorithm/move_backward.md @@ -120,3 +120,5 @@ BidirectionalIterator2 move_backward(BidirectionalIterator1 first, Bidirectional ## 参照 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) +- [LWG Issue 1206. Incorrect requires for `move_backward` and `copy_backward`](https://cplusplus.github.io/LWG/issue1206) + - C++11で、`result`が含まれてはならない範囲が`[first, last)`から`(first, last]`に修正された。後方へコピーする場合に上書きされうるのは`last`までであり、`first`は上書きされないため diff --git a/reference/algorithm/none_of.md b/reference/algorithm/none_of.md index b9635f7408..cb2478623a 100644 --- a/reference/algorithm/none_of.md +++ b/reference/algorithm/none_of.md @@ -107,3 +107,5 @@ bool none_of(InputIterator first, InputIterator last, Predicate pred) { - [N2666 More STL algorithms (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2666.pdf) - [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) +- [LWG Issue 1205. Some algorithms could more clearly document their handling of empty ranges](https://cplusplus.github.io/LWG/issue1205) + - C++11で、空のイテレータ範囲を渡した場合の戻り値が明記された diff --git a/reference/algorithm/partition.md b/reference/algorithm/partition.md index acda07d8ba..c5a04173de 100644 --- a/reference/algorithm/partition.md +++ b/reference/algorithm/partition.md @@ -118,6 +118,8 @@ ForwardIterator partition(ForwardIterator first, ForwardIterator last, Predicate ## 参照 -- [LWG Issue 2150. Unclear specification of `find_end`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2150) +- [LWG Issue 498. Requirements for `partition()` and `stable_partition()` too strong](https://cplusplus.github.io/LWG/issue498) + - C++11で、`partition`のイテレータ要件が`BidirectionalIterator`から`ForwardIterator`へ緩和され、計算量も`ForwardIterator`の場合の回数が別途規定された。前方向にしか進めないイテレータでも区分化は実装できるため - [P0574R1 Algorithm Complexity Constraints and Parallel Overloads](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0574r1.html) - [P0879R0 Constexpr for `swap` and `swap` related functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0879r0.html) +- [LWG Issue 2150. Unclear specification of `find_end`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2150) diff --git a/reference/algorithm/search.md b/reference/algorithm/search.md index 924fd6edb9..6b8d09da68 100644 --- a/reference/algorithm/search.md +++ b/reference/algorithm/search.md @@ -223,10 +223,14 @@ ForwardIterator1 search(ForwardIterator1 first1, ForwardIterator1 last1, - [`ranges::search`](/reference/algorithm/ranges_search.md) ## 参照 -- [LWG Issue 2150. Unclear specification of `find_end`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2150) -- [LWG Issue 4179. Wrong range in [alg.search]](https://cplusplus.github.io/LWG/issue4179) - - C++26で、探索対象のイテレータ`i`の範囲が`[first1, last1 - (last2 - first2)]`(右端を含む閉区間)であることが明確化された +- [LWG Issue 1205. Some algorithms could more clearly document their handling of empty ranges](https://cplusplus.github.io/LWG/issue1205) + - C++11で、空のイテレータ範囲を渡した場合の戻り値が明記された +- [LWG Issue 1338. LWG 1205 incorrectly applied](https://cplusplus.github.io/LWG/issue1338) + - C++11で、探索範囲の記述が`[first1, last1 - (last2 - first2))`と修正され、空範囲の場合の戻り値の記述が整理された - [N3905 Extending `std::search` to use Additional Searching Algorithms (Version 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3905.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) - [P0253R1 Fixing a design mistake in the searchers interface in Library Fundamentals](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0253r1.pdf) - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) +- [LWG Issue 2150. Unclear specification of `find_end`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2150) +- [LWG Issue 4179. Wrong range in [alg.search]](https://cplusplus.github.io/LWG/issue4179) + - C++26で、探索対象のイテレータ`i`の範囲が`[first1, last1 - (last2 - first2)]`(右端を含む閉区間)であることが明確化された diff --git a/reference/algorithm/shuffle.md b/reference/algorithm/shuffle.md index 05d5efd6ac..c2d6812164 100644 --- a/reference/algorithm/shuffle.md +++ b/reference/algorithm/shuffle.md @@ -129,7 +129,9 @@ void shuffle(RandomAccessIterator first, RandomAccessIterator last, UniformRando - [`ranges::shuffle`](/reference/algorithm/ranges_shuffle.md) ## 参照 -- [LWG Issue 2716. Specification of `shuffle` and `sample` disallows lvalue URNGs](https://cplusplus.github.io/LWG/issue2716) - - C++17で、乱数生成器の要件が`remove_reference_t`を通して判定されるよう整理され、左辺値の乱数生成器を渡せることが明確化された +- [LWG Issue 1432. `random_shuffle` signatures are inconsistent](https://cplusplus.github.io/LWG/issue1432) + - C++11で、乱数生成器の引数型が左辺値参照から右辺値参照へ改められた。一時オブジェクトの乱数生成器を渡せるようにするため - [P0346R1 A `` Nomenclature Tweak](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0346r1.pdf) - URNGをURBGに変更 +- [LWG Issue 2716. Specification of `shuffle` and `sample` disallows lvalue URNGs](https://cplusplus.github.io/LWG/issue2716) + - C++17で、乱数生成器の要件が`remove_reference_t`を通して判定されるよう整理され、左辺値の乱数生成器を渡せることが明確化された diff --git a/reference/algorithm/unique_copy.md b/reference/algorithm/unique_copy.md index 59e2657dc1..982c5345dc 100644 --- a/reference/algorithm/unique_copy.md +++ b/reference/algorithm/unique_copy.md @@ -183,5 +183,7 @@ OutputIterator unique_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) +- [LWG Issue 1241. `unique_copy` needs to require EquivalenceRelation](https://cplusplus.github.io/LWG/issue1241) + - C++11で、比較関数が同値関係でなければならないことが要件に追加された - [LWG Issue 4269. `unique_copy` passes arguments to its predicate backwards](https://cplusplus.github.io/LWG/issue4269) - C++26で、述語`pred`に渡す引数の順序が`pred(*i, *(i - 1))`から`pred(*(i - 1), *i)`へ修正された(記述上の引数順の誤りの修正。`pred`は同値関係であることが要求されるため動作は変わらない) From e2c050d692d476cdc1936461f8aac83a78bfa628 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:18:54 +0900 Subject: [PATCH 012/147] =?UTF-8?q?Predicate,=20BinaryPredicate,=20Compare?= =?UTF-8?q?=E3=81=AE=E8=A6=81=E4=BB=B6=E3=81=8Cbool=E3=81=B8=E3=81=AE?= =?UTF-8?q?=E6=96=87=E8=84=88=E4=BE=9D=E5=AD=98=E3=81=AE=E5=A4=89=E6=8F=9B?= =?UTF-8?q?=E3=81=8C=E3=81=A7=E3=81=8D=E3=82=8B=E3=81=93=E3=81=A8=E3=81=AB?= =?UTF-8?q?=E7=B5=B1=E4=B8=80=E3=81=95=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/reference/algorithm.md b/reference/algorithm.md index ee407da8c2..265d3243df 100644 --- a/reference/algorithm.md +++ b/reference/algorithm.md @@ -34,12 +34,12 @@ テンプレートパラメータ名が `Predicate` となっている場合、`Predicate` の値 `pred` と、引数として渡すイテレータ `i` について以下の要件を満たす必要がある -- `pred(*i)` が `bool` として評価できなければならない。 +- `pred(*i)` が `bool` へ文脈依存の変換をできなければならない。 - `pred(*i)` 内で `*i` を書き変えてはならない。 テンプレートパラメータ名が `BinaryPredicate` となっている場合、`BinaryPredicate` の値 `binary_pred` と、引数として渡すイテレータ `i1`, `i2` について以下の要件を満たす必要がある -- `binary_pred(*i1, *i2)` が `bool` として評価できなければならない。 +- `binary_pred(*i1, *i2)` が `bool` へ文脈依存の変換をできなければならない。 - `binary_pred(*i1, *i2)` 内で `*i1` や `*i2` を書き変えてはならない。 ### 要素の書き換え操作 @@ -471,7 +471,9 @@ ranges::sort(pv, {}, &Person::name); ## 参照 - [N2930 Range-Based For Loop Wording (Without Concepts)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html) - [N4821 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) -- [LWG Issue 4457. freestanding for `stable_sort`, `stable_partition` and `inplace_merge`](https://cplusplus.github.io/LWG/issue4457) - +- [LWG Issue 556. Is `Compare` a `BinaryPredicate`?](https://cplusplus.github.io/LWG/issue556) + - C++11で、`Predicate`・`BinaryPredicate`・`Compare`の戻り値の要件が「`bool`へ文脈依存の変換ができること」に統一された。それ以前は`Predicate`が「`true`として検査可能な値」、`Compare`が「`bool`へ文脈依存の変換」と揃っておらず、`Compare`が`BinaryPredicate`の要件を満たすかが不明確だった - [P2976R1 Freestanding Library: algorithm, numeric, and random](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2976r1.html) - C++26で、``の大部分(実行ポリシーをとる並列アルゴリズムを除く)がフリースタンディング処理系に対応した +- [LWG Issue 4457. freestanding for `stable_sort`, `stable_partition` and `inplace_merge`](https://cplusplus.github.io/LWG/issue4457) + From 5b029f406c2a3e16649b93463c88f9095b3bbc36 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:19:11 +0900 Subject: [PATCH 013/147] =?UTF-8?q?atomic=E3=83=98=E3=83=83=E3=83=80=20:?= =?UTF-8?q?=20LWG=20Issue=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/atomic.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/atomic.md b/reference/atomic.md index 87078901b3..d7c8709157 100644 --- a/reference/atomic.md +++ b/reference/atomic.md @@ -161,5 +161,9 @@ - [Boost Atomic Library](http://www.boost.org/doc/libs/release/libs/atomic/) - [P1642R11 Freestanding Library: Easy `[utilities]`, `[ranges]`, and `[iterators]`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1642r11.html) - C++23で、フリースタンディング処理系での``の要件が、フリースタンディングエンティティの仕組みに基づいて整理された +- [LWG Issue 943. `ssize_t` undefined](https://cplusplus.github.io/LWG/issue943) + - C++11で、標準の`typedef`に対するアトミック型の一覧から`atomic_ssize_t`が削除された。`ssize_t`はPOSIXの型であり、C++の標準ライブラリでは定義されていないため +- [LWG Issue 1360. Add `` to free-standing implementations](https://cplusplus.github.io/LWG/issue1360) + - C++11で、このヘッダがフリースタンディング処理系でも提供されることが規定された - [LWG Issue 3814. Add freestanding items requested by NB comments](https://cplusplus.github.io/LWG/issue3814) - C++23で、`memory_order`の各定数などがフリースタンディング処理系で使用可能であることが追加で規定された From 2a7ea00cf7f3976783c6b9e592d3543f5a65d4ca Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:19:32 +0900 Subject: [PATCH 014/147] =?UTF-8?q?cmath=20:=20LWG=20Issue=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/cmath/isgreater.md | 6 ++++-- reference/cmath/isgreaterequal.md | 6 ++++-- reference/cmath/isless.md | 6 ++++-- reference/cmath/islessequal.md | 6 ++++-- reference/cmath/islessgreater.md | 6 ++++-- reference/cmath/isunordered.md | 6 ++++-- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/reference/cmath/isgreater.md b/reference/cmath/isgreater.md index 63fa38e48f..d18c31a8a8 100644 --- a/reference/cmath/isgreater.md +++ b/reference/cmath/isgreater.md @@ -106,9 +106,11 @@ isgreater(nan, nan) = false ## 参照 -- [LWG Issue 3051. Floating point classifications were inadvertently changed in P0175](https://cplusplus.github.io/LWG/issue3051) - - C++20で、P0175が誤ってこれらの関数の戻り値型を`bool`から`int`に変更していたのが修正され、`bool`に戻された +- [LWG Issue 1441. Floating-point test functions are incorrectly specified](https://cplusplus.github.io/LWG/issue1441) + - C++11で、C言語のマクロではなく、`float`/`double`/`long double`それぞれに対するオーバーロードとして規定された - [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`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [LWG Issue 3051. Floating point classifications were inadvertently changed in P0175](https://cplusplus.github.io/LWG/issue3051) + - C++20で、P0175が誤ってこれらの関数の戻り値型を`bool`から`int`に変更していたのが修正され、`bool`に戻された diff --git a/reference/cmath/isgreaterequal.md b/reference/cmath/isgreaterequal.md index 31016d4cbc..09f905ff28 100644 --- a/reference/cmath/isgreaterequal.md +++ b/reference/cmath/isgreaterequal.md @@ -106,9 +106,11 @@ isgreaterequal(nan, nan) = false ## 参照 -- [LWG Issue 3051. Floating point classifications were inadvertently changed in P0175](https://cplusplus.github.io/LWG/issue3051) - - C++20で、P0175が誤ってこれらの関数の戻り値型を`bool`から`int`に変更していたのが修正され、`bool`に戻された +- [LWG Issue 1441. Floating-point test functions are incorrectly specified](https://cplusplus.github.io/LWG/issue1441) + - C++11で、C言語のマクロではなく、`float`/`double`/`long double`それぞれに対するオーバーロードとして規定された - [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`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [LWG Issue 3051. Floating point classifications were inadvertently changed in P0175](https://cplusplus.github.io/LWG/issue3051) + - C++20で、P0175が誤ってこれらの関数の戻り値型を`bool`から`int`に変更していたのが修正され、`bool`に戻された diff --git a/reference/cmath/isless.md b/reference/cmath/isless.md index aa3a5273e6..ccb321998f 100644 --- a/reference/cmath/isless.md +++ b/reference/cmath/isless.md @@ -106,9 +106,11 @@ isless(nan, nan) = false ## 参照 -- [LWG Issue 3051. Floating point classifications were inadvertently changed in P0175](https://cplusplus.github.io/LWG/issue3051) - - C++20で、P0175が誤ってこれらの関数の戻り値型を`bool`から`int`に変更していたのが修正され、`bool`に戻された +- [LWG Issue 1441. Floating-point test functions are incorrectly specified](https://cplusplus.github.io/LWG/issue1441) + - C++11で、C言語のマクロではなく、`float`/`double`/`long double`それぞれに対するオーバーロードとして規定された - [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`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [LWG Issue 3051. Floating point classifications were inadvertently changed in P0175](https://cplusplus.github.io/LWG/issue3051) + - C++20で、P0175が誤ってこれらの関数の戻り値型を`bool`から`int`に変更していたのが修正され、`bool`に戻された diff --git a/reference/cmath/islessequal.md b/reference/cmath/islessequal.md index 661314d052..6d866859c9 100644 --- a/reference/cmath/islessequal.md +++ b/reference/cmath/islessequal.md @@ -106,9 +106,11 @@ islessequal(nan, nan) = false ## 参照 -- [LWG Issue 3051. Floating point classifications were inadvertently changed in P0175](https://cplusplus.github.io/LWG/issue3051) - - C++20で、P0175が誤ってこれらの関数の戻り値型を`bool`から`int`に変更していたのが修正され、`bool`に戻された +- [LWG Issue 1441. Floating-point test functions are incorrectly specified](https://cplusplus.github.io/LWG/issue1441) + - C++11で、C言語のマクロではなく、`float`/`double`/`long double`それぞれに対するオーバーロードとして規定された - [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`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [LWG Issue 3051. Floating point classifications were inadvertently changed in P0175](https://cplusplus.github.io/LWG/issue3051) + - C++20で、P0175が誤ってこれらの関数の戻り値型を`bool`から`int`に変更していたのが修正され、`bool`に戻された diff --git a/reference/cmath/islessgreater.md b/reference/cmath/islessgreater.md index 98ac4fac45..58c90416e8 100644 --- a/reference/cmath/islessgreater.md +++ b/reference/cmath/islessgreater.md @@ -106,9 +106,11 @@ islessgreater(nan, nan) = false ## 参照 -- [LWG Issue 3051. Floating point classifications were inadvertently changed in P0175](https://cplusplus.github.io/LWG/issue3051) - - C++20で、P0175が誤ってこれらの関数の戻り値型を`bool`から`int`に変更していたのが修正され、`bool`に戻された +- [LWG Issue 1441. Floating-point test functions are incorrectly specified](https://cplusplus.github.io/LWG/issue1441) + - C++11で、C言語のマクロではなく、`float`/`double`/`long double`それぞれに対するオーバーロードとして規定された - [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`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [LWG Issue 3051. Floating point classifications were inadvertently changed in P0175](https://cplusplus.github.io/LWG/issue3051) + - C++20で、P0175が誤ってこれらの関数の戻り値型を`bool`から`int`に変更していたのが修正され、`bool`に戻された diff --git a/reference/cmath/isunordered.md b/reference/cmath/isunordered.md index 3c93d80186..18eed8eabe 100644 --- a/reference/cmath/isunordered.md +++ b/reference/cmath/isunordered.md @@ -89,9 +89,11 @@ isunordered(1, inf) = false ## 参照 -- [LWG Issue 3051. Floating point classifications were inadvertently changed in P0175](https://cplusplus.github.io/LWG/issue3051) - - C++20で、P0175が誤ってこれらの関数の戻り値型を`bool`から`int`に変更していたのが修正され、`bool`に戻された +- [LWG Issue 1441. Floating-point test functions are incorrectly specified](https://cplusplus.github.io/LWG/issue1441) + - C++11で、C言語のマクロではなく、`float`/`double`/`long double`それぞれに対するオーバーロードとして規定された - [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`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [LWG Issue 3051. Floating point classifications were inadvertently changed in P0175](https://cplusplus.github.io/LWG/issue3051) + - C++20で、P0175が誤ってこれらの関数の戻り値型を`bool`から`int`に変更していたのが修正され、`bool`に戻された From 2300bbe0a87ac014962c64984ac1401d66386bff Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:19:42 +0900 Subject: [PATCH 015/147] =?UTF-8?q?Invoke=20:=20LWG=20Issue=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/concepts/Invoke.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/concepts/Invoke.md b/reference/concepts/Invoke.md index 018ecb68d0..5c138ad541 100644 --- a/reference/concepts/Invoke.md +++ b/reference/concepts/Invoke.md @@ -84,6 +84,8 @@ C++20 における 2. について、次の文言を項目の最後に追加す - [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) +- [LWG Issue 1520. INVOKE on member data pointer with too many arguments](https://cplusplus.github.io/LWG/issue1520) + - C++11で、メンバ変数へのポインタを扱う規則に、引数がひとつであるという条件が追加された。余分な引数を渡した場合に、この規則が適用されないようにするため - [LWG Issue 2219. `INVOKE`-ing a pointer to member with a `reference_wrapper` as the object expression](https://cplusplus.github.io/LWG/issue2219) - C++17で、メンバポインタに対する第1引数が[`reference_wrapper`](/reference/functional/reference_wrapper.md)の特殊化である場合に、`t1.get()`経由でメンバを呼び出すよう規定された - [LWG Issue 3655. The *INVOKE* operation and union types](https://cplusplus.github.io/LWG/issue3655) From 2b981076109481d397effc772c1a24b57d3b60b9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:20:19 +0900 Subject: [PATCH 016/147] =?UTF-8?q?condition=5Fvariable(=5Fany)=20:=20LWG?= =?UTF-8?q?=20Issue=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/condition_variable/condition_variable.md | 2 ++ .../condition_variable/condition_variable/notify_all.md | 2 ++ .../condition_variable/condition_variable/notify_one.md | 2 ++ .../condition_variable/op_constructor.md | 2 ++ reference/condition_variable/condition_variable/wait.md | 4 ++++ .../condition_variable/condition_variable/wait_for.md | 4 ++++ .../condition_variable/condition_variable/wait_until.md | 8 ++++++-- .../condition_variable_any/notify_all.md | 2 ++ .../condition_variable_any/notify_one.md | 2 ++ .../condition_variable/condition_variable_any/wait.md | 4 +++- .../condition_variable/condition_variable_any/wait_for.md | 8 ++++++-- .../condition_variable_any/wait_until.md | 8 ++++++-- 12 files changed, 41 insertions(+), 7 deletions(-) diff --git a/reference/condition_variable/condition_variable.md b/reference/condition_variable/condition_variable.md index 0f41c76508..25a3533812 100644 --- a/reference/condition_variable/condition_variable.md +++ b/reference/condition_variable/condition_variable.md @@ -133,6 +133,8 @@ process data ## 参照 - [Condition Variables - Operating Systems: Three Easy Pieces](http://pages.cs.wisc.edu/~remzi/OSTEP/threads-cv.pdf) +- [LWG Issue 1220. What does `condition_variable` wait on?](https://cplusplus.github.io/LWG/issue1220) + - C++11で、このクラスが待機できるのが[`unique_lock`](/reference/mutex/unique_lock.md)`<`[`mutex`](/reference/mutex/mutex.md)`>`のオブジェクトであることが明記された - [LWG Issue 2190. Condition variable specification](https://cplusplus.github.io/LWG/issue2190) - C++14で、条件変数の操作が「ある未規定な全順序」ではなく「happens beforeの順序と一貫した単一の未規定な全順序」で実行されると規定された - この修正は欠陥報告(DR)であり、C++11以降に遡及して適用される。元の規定では複数の全順序が存在しうると読め、待機と通知の順序がプログラムの実行順序と矛盾することを許してしまっていたが、これは矛盾した文言の修正であり、処理系の動作は変わらないため diff --git a/reference/condition_variable/condition_variable/notify_all.md b/reference/condition_variable/condition_variable/notify_all.md index d6b04f5de9..612b4e78e5 100644 --- a/reference/condition_variable/condition_variable/notify_all.md +++ b/reference/condition_variable/condition_variable/notify_all.md @@ -104,3 +104,5 @@ process data ## 参照 +- [LWG Issue 1089. Unify "Throws: Nothing." specifications](https://cplusplus.github.io/LWG/issue1089) + - C++11で、この関数が例外を送出しないことが明記された diff --git a/reference/condition_variable/condition_variable/notify_one.md b/reference/condition_variable/condition_variable/notify_one.md index c41ddb3387..cd24c96225 100644 --- a/reference/condition_variable/condition_variable/notify_one.md +++ b/reference/condition_variable/condition_variable/notify_one.md @@ -101,3 +101,5 @@ process data ## 参照 +- [LWG Issue 1089. Unify "Throws: Nothing." specifications](https://cplusplus.github.io/LWG/issue1089) + - C++11で、この関数が例外を送出しないことが明記された diff --git a/reference/condition_variable/condition_variable/op_constructor.md b/reference/condition_variable/condition_variable/op_constructor.md index a914cba0c0..0f4b9cdf00 100644 --- a/reference/condition_variable/condition_variable/op_constructor.md +++ b/reference/condition_variable/condition_variable/op_constructor.md @@ -47,3 +47,5 @@ int main() - 2012までは、delete宣言に対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 ## 参照 +- [LWG Issue 965. Various threading bugs #15](https://cplusplus.github.io/LWG/issue965) + - C++11で、コンストラクタが送出しうるエラー条件から`device_or_resource_busy`が削除された。これはPOSIXのエラーだが、C++では宣言と初期化が分離されないため発生しえないため diff --git a/reference/condition_variable/condition_variable/wait.md b/reference/condition_variable/condition_variable/wait.md index e58d656d6d..4540e92eb8 100644 --- a/reference/condition_variable/condition_variable/wait.md +++ b/reference/condition_variable/condition_variable/wait.md @@ -163,5 +163,9 @@ process data ## 参照 +- [LWG Issue 1222. `condition_variable` incorrect effects for exception safety](https://cplusplus.github.io/LWG/issue1222) + - C++11で、例外送出によってこの関数を抜ける場合に呼び出されるのが`lock.unlock()`ではなく`lock.`[`lock()`](/reference/mutex/unique_lock/lock.md)であると修正された +- [LWG Issue 1497. `lock()` postcondition can not be generally achieved](https://cplusplus.github.io/LWG/issue1497) + - C++11で、要件と事後条件が`lock.`[`owns_lock()`](/reference/mutex/unique_lock/owns_lock.md)`== true`かつ`lock.mutex()`が呼び出し元スレッドでロックされていることという形へ整理された - [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 4adf6efb03..c438322511 100644 --- a/reference/condition_variable/condition_variable/wait_for.md +++ b/reference/condition_variable/condition_variable/wait_for.md @@ -179,6 +179,10 @@ process data ## 参照 +- [LWG Issue 857. `condition_variable::time_wait` return bool error prone](https://cplusplus.github.io/LWG/issue857) + - C++11で、述語を取らないオーバーロードの戻り値が`bool`から[`cv_status`](/reference/condition_variable/cv_status.md)へ変更された。`bool`ではタイムアウトを表すのか条件成立を表すのかが読み取れず、取り違えやすかったため +- [LWG Issue 859. Monotonic Clock is Conditionally Supported?](https://cplusplus.github.io/LWG/issue859) + - C++11で、効果を[`wait_until()`](wait_until.md)経由で規定するのをやめ、この関数自体のブロッキング動作として直接規定するよう改められた。当時の`monotonic_clock`が条件付きサポートであり、その存在を前提にできなかったため。あわせて、ロック状態に関する事前条件が追加された - [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) - [LWG Issue 3504. `condition_variable::wait_for` is overspecified](https://cplusplus.github.io/LWG/issue3504) diff --git a/reference/condition_variable/condition_variable/wait_until.md b/reference/condition_variable/condition_variable/wait_until.md index fccedd99bd..0bc594ce6f 100644 --- a/reference/condition_variable/condition_variable/wait_until.md +++ b/reference/condition_variable/condition_variable/wait_until.md @@ -200,9 +200,13 @@ 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) +- [LWG Issue 857. `condition_variable::time_wait` return bool error prone](https://cplusplus.github.io/LWG/issue857) + - C++11で、述語を取らないオーバーロードの戻り値が`bool`から[`cv_status`](/reference/condition_variable/cv_status.md)へ変更された。`bool`ではタイムアウトを表すのか条件成立を表すのかが読み取れず、取り違えやすかったため +- [LWG Issue 1222. `condition_variable` incorrect effects for exception safety](https://cplusplus.github.io/LWG/issue1222) + - C++11で、例外送出によってこの関数を抜ける場合に呼び出されるのが`lock.unlock()`ではなく`lock.`[`lock()`](/reference/mutex/unique_lock/lock.md)であると修正された - [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`がサポートされた +- [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) - [LWG Issue 4301. `condition_variable{_any}::wait_{for, until}` should take timeout by value](https://cplusplus.github.io/LWG/issue4301) - C++26で、`wait_until`/`wait_for`のタイムアウト引数(`time_point`/`duration`)が`const`参照渡しから値渡しへ変更された diff --git a/reference/condition_variable/condition_variable_any/notify_all.md b/reference/condition_variable/condition_variable_any/notify_all.md index a5f351490e..45852752ed 100644 --- a/reference/condition_variable/condition_variable_any/notify_all.md +++ b/reference/condition_variable/condition_variable_any/notify_all.md @@ -106,3 +106,5 @@ process data ## 参照 +- [LWG Issue 1089. Unify "Throws: Nothing." specifications](https://cplusplus.github.io/LWG/issue1089) + - C++11で、この関数が例外を送出しないことが明記された diff --git a/reference/condition_variable/condition_variable_any/notify_one.md b/reference/condition_variable/condition_variable_any/notify_one.md index 3b26534a14..732f1a5508 100644 --- a/reference/condition_variable/condition_variable_any/notify_one.md +++ b/reference/condition_variable/condition_variable_any/notify_one.md @@ -102,3 +102,5 @@ process data ## 参照 +- [LWG Issue 1089. Unify "Throws: Nothing." specifications](https://cplusplus.github.io/LWG/issue1089) + - C++11で、この関数が例外を送出しないことが明記された diff --git a/reference/condition_variable/condition_variable_any/wait.md b/reference/condition_variable/condition_variable_any/wait.md index a62f4f5af1..75567a0f0f 100644 --- a/reference/condition_variable/condition_variable_any/wait.md +++ b/reference/condition_variable/condition_variable_any/wait.md @@ -178,7 +178,9 @@ process data ## 参照 +- [LWG Issue 1222. `condition_variable` incorrect effects for exception safety](https://cplusplus.github.io/LWG/issue1222) + - C++11で、例外送出によってこの関数を抜ける場合に呼び出されるのが`lock.unlock()`ではなく`lock.`[`lock()`](/reference/mutex/unique_lock/lock.md)であると修正された - [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) - [P0660R10 Stop Token and Joining Thread, Rev 10](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0660r10.pdf) - [P1869R1 Rename `condition_variable_any` interruptible wait methods](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1869r1.html) +- [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_any/wait_for.md b/reference/condition_variable/condition_variable_any/wait_for.md index 69338a285e..0482437322 100644 --- a/reference/condition_variable/condition_variable_any/wait_for.md +++ b/reference/condition_variable/condition_variable_any/wait_for.md @@ -193,10 +193,14 @@ 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) +- [LWG Issue 857. `condition_variable::time_wait` return bool error prone](https://cplusplus.github.io/LWG/issue857) + - C++11で、述語を取らないオーバーロードの戻り値が`bool`から[`cv_status`](/reference/condition_variable/cv_status.md)へ変更された。`bool`ではタイムアウトを表すのか条件成立を表すのかが読み取れず、取り違えやすかったため +- [LWG Issue 1267. Incorrect wording for `condition_variable_any::wait_for`](https://cplusplus.github.io/LWG/issue1267) + - C++11で、[`condition_variable`](/reference/condition_variable/condition_variable.md)由来の事前条件が削除された。このクラスは任意のロック型を扱うため、`lock.mutex()`を前提にできないため - [P0660R10 Stop Token and Joining Thread, Rev 10](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0660r10.pdf) - [P1869R1 Rename `condition_variable_any` interruptible wait methods](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1869r1.html) +- [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) - [LWG Issue 3504. `condition_variable::wait_for` is overspecified](https://cplusplus.github.io/LWG/issue3504) - C++26で、相対時間を絶対時間へ変換する際に`ceil`で整数時間へ丸めるよう変更され、浮動小数点の`duration`での精度の問題が修正された。この変更は欠陥報告 (DR) であり、C++26より前のバージョンでもコンパイラが早期に対応している場合がある - [LWG Issue 4301. `condition_variable{_any}::wait_{for, until}` should take timeout by value](https://cplusplus.github.io/LWG/issue4301) diff --git a/reference/condition_variable/condition_variable_any/wait_until.md b/reference/condition_variable/condition_variable_any/wait_until.md index f5c2a81470..5ee70a4fa5 100644 --- a/reference/condition_variable/condition_variable_any/wait_until.md +++ b/reference/condition_variable/condition_variable_any/wait_until.md @@ -224,11 +224,15 @@ 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) +- [LWG Issue 857. `condition_variable::time_wait` return bool error prone](https://cplusplus.github.io/LWG/issue857) + - C++11で、述語を取らないオーバーロードの戻り値が`bool`から[`cv_status`](/reference/condition_variable/cv_status.md)へ変更された。`bool`ではタイムアウトを表すのか条件成立を表すのかが読み取れず、取り違えやすかったため +- [LWG Issue 1222. `condition_variable` incorrect effects for exception safety](https://cplusplus.github.io/LWG/issue1222) + - C++11で、例外送出によってこの関数を抜ける場合に呼び出されるのが`lock.unlock()`ではなく`lock.`[`lock()`](/reference/mutex/unique_lock/lock.md)であると修正された - [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`がサポートされた - [P0660R10 Stop Token and Joining Thread, Rev 10](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0660r10.pdf) - [P1869R1 Rename `condition_variable_any` interruptible wait methods](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1869r1.html) +- [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) - [LWG Issue 4301. `condition_variable{_any}::wait_{for, until}` should take timeout by value](https://cplusplus.github.io/LWG/issue4301) - C++26で、`wait_until`/`wait_for`のタイムアウト引数(`time_point`/`duration`)が`const`参照渡しから値渡しへ変更された From abcaf7914ab82ec6090d97646ff5a221edbd7905 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:21:25 +0900 Subject: [PATCH 017/147] =?UTF-8?q?condition=5Fvariable=E3=81=AE=E3=83=87?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=20:=20=E7=A0=B4?= =?UTF-8?q?=E6=A3=84=E5=BE=8C=E3=81=AB=E5=BE=85=E6=A9=9F=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=B9=E3=83=AC=E3=83=83=E3=83=89=E3=81=8C=E8=A1=A8=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E5=88=A9=E7=94=A8=E8=80=85?= =?UTF-8?q?=E5=81=B4=E3=81=8C=E4=BF=9D=E8=A8=BC=E3=81=99=E3=82=8B=E3=81=93?= =?UTF-8?q?=E3=81=A8=E3=81=8C=E5=BF=85=E8=A6=81=E3=81=A7=E3=81=82=E3=82=8B?= =?UTF-8?q?=E6=B3=A8=E8=A8=98=E3=81=8C=E8=BF=BD=E5=8A=A0=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../condition_variable/op_destructor.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/reference/condition_variable/condition_variable/op_destructor.md b/reference/condition_variable/condition_variable/op_destructor.md index ee88010a6b..53ae2e8a5b 100644 --- a/reference/condition_variable/condition_variable/op_destructor.md +++ b/reference/condition_variable/condition_variable/op_destructor.md @@ -14,9 +14,9 @@ ## 要件 -`*this`を参照している全てのスレッドがブロッキングされていないこと。 - -つまり、デストラクタが呼び出される前に、`*this`の`condition_variable`オブジェクトを待機している全てのスレッドに起床通知を送らなければならない。 +- `*this`を参照している全てのスレッドがブロッキングされていないこと。 +- つまり、デストラクタが呼び出される前に、`*this`の`condition_variable`オブジェクトを待機している全てのスレッドに起床通知を送らなければならない。 +- デストラクタの実行が開始されたあとに`*this`を待機するスレッドが現れないよう、利用者が保証する必要がある。とくに、待機しているスレッドが条件変数を含むオブジェクトへアクセスする場合に注意が必要である。 ## 効果 @@ -45,3 +45,5 @@ ## 参照 +- [LWG Issue 1221. `condition_variable` wording](https://cplusplus.github.io/LWG/issue1221) + - C++11で、破棄後に待機するスレッドが現れないよう利用者が保証する必要があるという注記へ改められた From 29555e4344124fe6c63343e33379ef63334c8455 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:27:41 +0900 Subject: [PATCH 018/147] =?UTF-8?q?longjmp=20:=20C++11=E3=81=A8C++20?= =?UTF-8?q?=E3=81=A7=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=8B=E6=9D=A1=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/csetjmp/longjmp.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/reference/csetjmp/longjmp.md b/reference/csetjmp/longjmp.md index 012bc88ce0..9276c9fbdf 100644 --- a/reference/csetjmp/longjmp.md +++ b/reference/csetjmp/longjmp.md @@ -16,9 +16,7 @@ namespace std { ## 効果 * `setjmp()`によって第一引数`env`に保存された実行環境(スタックポインタ、プログラムカウンタ等)を復元する。 - * プログラムの実行地点を、対応する[`setjmp()`](setjmp.md)の呼び出し地点へジャンプさせる。 - * ジャンプ先の[`setjmp()`](setjmp.md)は、この関数の第二引数`val`を戻り値として返す。ただし、`val`が0の場合は1を返す。 ## 戻り値 @@ -28,8 +26,10 @@ namespace std { ## 備考 以下の場合、動作は未定義である。 -* 対応する `setjmp` と `longjmp` を `catch` と `throw` に置き換えることで、自動記憶域期間を持つオブジェクトの非トリビアルなデストラクタが呼び出される場合。例えば、`setjmp` と `longjmp` の間で、非トリビアルなデストラクタを持つオブジェクトの生存期間が開始し、終了しない場合(ジャンプによってデストラクタを飛ばす場合) -* コルーチンのサスペンションコンテキスト内で呼び出された場合 +* 対応する `setjmp` と `longjmp` を `catch` と `throw` に置き換えたときに、自動記憶域期間を持つオブジェクトのデストラクタが関係する場合 + * C++98 : そのオブジェクトが破棄される場合。デストラクタがトリビアルであるかどうかは問わない + * C++11 : そのオブジェクトの非トリビアルなデストラクタが呼び出される場合。例えば、`setjmp` と `longjmp` の間で、非トリビアルなデストラクタを持つオブジェクトの生存期間が開始し、終了しない場合(ジャンプによってデストラクタを飛ばす場合) +* C++20 : コルーチンのサスペンションコンテキスト (`co_await`式の評価中) で呼び出された場合 * 対応する`setjmp`が存在しない場合(`env`が有効な環境を保存していない場合) * `longjmp`は、対応する`setjmp`の呼び出しから同一スレッド内で呼び出されなければならない。異なるスレッドから呼び出された場合 * `setjmp`を呼び出した関数の実行が終了している場合 @@ -72,3 +72,10 @@ int main () { ## 関連項目 * [`jmp_buf`](jmp_buf.md) * [`setjmp`](setjmp.md) + + +## 参照 +- [LWG Issue 894. `longjmp` and destructors](https://cplusplus.github.io/LWG/issue894) + - C++11で、動作は未定義となる条件が「自動記憶域期間のオブジェクトを破棄する場合」から「非トリビアルなデストラクタを呼び出す場合」に限定された。トリビアルなデストラクタしか持たないオブジェクトを飛び越えるだけであれば、実際には問題が起きず、既存の実装もそのような使い方を許していたため +- [P0912R5 Merge Coroutines TS into C++20 working draft](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0912r5.html) + - C++20で、コルーチンのサスペンションコンテキストでこの関数を呼び出した場合の動作は未定義であることが規定された From 0f11c90e162a21f20ec6672dab7abfeefc6f458d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:37:51 +0900 Subject: [PATCH 019/147] =?UTF-8?q?offset=20:=20=E3=83=9E=E3=82=AF?= =?UTF-8?q?=E3=83=AD=E3=81=AE=E5=B1=95=E9=96=8B=E7=B5=90=E6=9E=9C=E3=82=92?= =?UTF-8?q?noexcept=E3=81=AB=E6=B8=A1=E3=81=97=E3=81=9F=E7=B5=90=E6=9E=9C?= =?UTF-8?q?=E3=81=8Ctrue=E3=81=A7=E3=81=82=E3=82=8B=E3=81=93=E3=81=A8?= =?UTF-8?q?=E3=81=8CC++11=E3=81=A7=E8=A6=8F=E5=AE=9A=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstddef/offsetof.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reference/cstddef/offsetof.md b/reference/cstddef/offsetof.md index f10fd6b152..e53a9d4dee 100644 --- a/reference/cstddef/offsetof.md +++ b/reference/cstddef/offsetof.md @@ -25,6 +25,12 @@ C++ での構造体の機能的拡張のため、`offsetof` の利用は、C++11 `type` 中の `member` へのオフセット値を示す `size_t` 型の値 +## 例外 +投げない。 + +C++11から、このマクロの展開結果を`noexcept`演算子に渡した`noexcept(offsetof(type, member))`は`true`となることが規定されている。 + + ## 例 ```cpp example #include @@ -54,5 +60,7 @@ offsetof(mystruct,anotherchar) is 11 ## 参照 +- [LWG Issue 1363. offsetof should be marked `noexcept`](https://cplusplus.github.io/LWG/issue1363) + - C++11で、このマクロが例外を送出せず、`noexcept(offsetof(type, member-designator))`が`true`となることが規定された - [LWG Issue 2709. `offsetof` is unnecessarily imprecise](https://cplusplus.github.io/LWG/issue2709) - C++17で、標準レイアウトでないクラス型に対する`offsetof`の利用が「未定義動作」から「条件付きサポート」に変更された From e3f1edcd35b047652e31f62c8397fd9019ddcef9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:38:32 +0900 Subject: [PATCH 020/147] =?UTF-8?q?unique=5Fcopy=20:=20C++11=E3=81=A7pred?= =?UTF-8?q?=E3=81=8C=E5=90=8C=E5=80=A4=E9=96=A2=E4=BF=82=E3=81=A7=E3=81=AA?= =?UTF-8?q?=E3=81=91=E3=82=8C=E3=81=B0=E3=81=AA=E3=82=89=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=80=81=E3=81=A8=E3=81=84=E3=81=86=E8=A6=81=E4=BB=B6=E3=81=8C?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=95=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/unique_copy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/algorithm/unique_copy.md b/reference/algorithm/unique_copy.md index 982c5345dc..6982765f4b 100644 --- a/reference/algorithm/unique_copy.md +++ b/reference/algorithm/unique_copy.md @@ -56,7 +56,7 @@ namespace std { ## 要件 -- 二項関数オブジェクト`pred`は、ふたつの値の等値性を判定できなければならない +- 二項関数オブジェクト`pred`は、ふたつの値の等値性を判定できなければならない。また、`pred`は同値関係でなければならない - `[first,last)` と `[result,result + (last - first))` は重なっていてはならない From 076ad08b1c5c7cd3b9e6ab9666622bc1b3ae326d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:38:52 +0900 Subject: [PATCH 021/147] =?UTF-8?q?duration=20:=20=E3=83=AA=E3=83=86?= =?UTF-8?q?=E3=83=A9=E3=83=AB=E5=9E=8B=E3=81=A7=E3=81=82=E3=82=8B=E3=81=93?= =?UTF-8?q?=E3=81=A8=E3=81=8C=E8=A6=8F=E5=AE=9A=E3=81=95=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/duration.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/chrono/duration.md b/reference/chrono/duration.md index 2933a3359a..472d673e0c 100644 --- a/reference/chrono/duration.md +++ b/reference/chrono/duration.md @@ -34,6 +34,9 @@ namespace chrono { | [`months`](/reference/chrono/duration_aliases.md) | 月 | C++20 | +このクラスはリテラル型である。コンストラクタ、算術演算子、比較演算子、[`duration_cast`](duration_cast.md)は`constexpr`であり、定数式で時間の計算を行える。 + + ## 適格要件 - `Rep`が`duration`の特殊化ではないこと。 - C++26 : `Rep`がCV修飾された型ではないこと。 From 853e03a2c0fe8c18bc2db86359e382c45a64437f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Aug 2026 16:41:20 +0900 Subject: [PATCH 022/147] =?UTF-8?q?abort=20:=20LWG=20Issuue=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=97=E3=80=81=E3=82=AA=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89=E7=95=AA=E5=8F=B7=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/cstdlib/abort.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/reference/cstdlib/abort.md b/reference/cstdlib/abort.md index 5793049422..cdd9035107 100644 --- a/reference/cstdlib/abort.md +++ b/reference/cstdlib/abort.md @@ -5,8 +5,8 @@ ```cpp namespace std { - void abort(); // C++98 - [[noreturn]] void abort() noexcept; // C++11 + void abort(); // (1) C++98 + [[noreturn]] void abort() noexcept; // (1) C++11 } ``` @@ -51,3 +51,8 @@ int main() ``` Aborted ``` + + +## 参照 +- [LWG Issue 1066. Use `[[noreturn]]` attribute in the library](https://cplusplus.github.io/LWG/issue1066) + - C++11で、呼び出し元へ戻らない標準ライブラリ関数に`[[noreturn]]`属性が付加された From 251a14074b1bf511015c6b436893b40d8ea607d0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 09:55:44 +0900 Subject: [PATCH 023/147] =?UTF-8?q?at=5Fquick=5Fexit=20:=20=E7=99=BB?= =?UTF-8?q?=E9=8C=B2=E3=81=95=E3=82=8C=E3=81=9F=E9=96=A2=E6=95=B0=E3=81=8C?= =?UTF-8?q?=E9=80=86=E9=A0=86=E3=81=AB=E5=91=BC=E3=81=B0=E3=82=8C=E3=82=8B?= =?UTF-8?q?=E3=81=93=E3=81=A8=E3=81=8C=E6=98=8E=E8=A8=98=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/at_quick_exit.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/cstdlib/at_quick_exit.md b/reference/cstdlib/at_quick_exit.md index 05a2f6c2b8..e490c5e31e 100644 --- a/reference/cstdlib/at_quick_exit.md +++ b/reference/cstdlib/at_quick_exit.md @@ -29,6 +29,8 @@ namespace std { - この関数は、フリースタンディング処理系でも使用できる。 - この関数では、複数の関数を登録できる。 - 登録できる上限数は実装定義だが、32個以上は登録できることが実装に要求される。 +- 登録された関数は、登録した順序と逆順に呼び出される。 + - 複数のスレッドから並行にこの関数を呼び出した場合、それらの呼び出しどうしの順序は不定順である。 ## 例 @@ -69,3 +71,7 @@ on exit ## 参照 - [N2440 Abandoning a Process](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm) +- [LWG Issue 1144. "thread safe" is undefined](https://cplusplus.github.io/LWG/issue1144) + - C++11で、登録された関数どうしの実行順序と、登録の呼び出しに対する順序関係が整理された。並行に呼び出された`at_quick_exit()`どうしの順序は不定順である +- [LWG Issue 1264. `quick_exit` support for freestanding implementations](https://cplusplus.github.io/LWG/issue1264) + - C++11で、フリースタンディング処理系でもこの関数が提供されることが規定された From 054db4101b6a7bc5a86e73cb713056e8d6fee659 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 09:56:15 +0900 Subject: [PATCH 024/147] =?UTF-8?q?exit,=20=5FExit,=20quick=5Fexit=20:=20L?= =?UTF-8?q?WG=20Issue=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/exit.md | 9 +++++++-- reference/cstdlib/exit_.md | 2 ++ reference/cstdlib/quick_exit.md | 6 +++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/reference/cstdlib/exit.md b/reference/cstdlib/exit.md index 8707193f3b..fc87f0f9b5 100644 --- a/reference/cstdlib/exit.md +++ b/reference/cstdlib/exit.md @@ -5,8 +5,8 @@ ```cpp namespace std { - void exit(int status); // C++98 - [[noreturn]] void exit(int status); // C++11 + void exit(int status); // (1) C++98 + [[noreturn]] void exit(int status); // (1) C++11 } ``` @@ -71,3 +71,8 @@ int main() |------|------| | [`atexit`](atexit.md) | プログラムが通常の方法で終了するときに呼ばれる関数を登録する | | [`quick_exit`](quick_exit.md) | 後処理をせずに、プログラムを終了させる | + + +## 参照 +- [LWG Issue 1066. Use `[[noreturn]]` attribute in the library](https://cplusplus.github.io/LWG/issue1066) + - C++11で、呼び出し元へ戻らない標準ライブラリ関数に`[[noreturn]]`属性が付加された diff --git a/reference/cstdlib/exit_.md b/reference/cstdlib/exit_.md index 308e4cd813..6c473a442a 100644 --- a/reference/cstdlib/exit_.md +++ b/reference/cstdlib/exit_.md @@ -91,3 +91,5 @@ 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) +- [LWG Issue 993. `_Exit` needs better specification](https://cplusplus.github.io/LWG/issue993) + - C++11で、この関数が自動記憶域期間・スレッド記憶域期間・静的記憶域期間のオブジェクトのデストラクタを実行せず、[`atexit`](atexit.md)で登録した関数も呼び出さずにプログラムを終了することが明記された diff --git a/reference/cstdlib/quick_exit.md b/reference/cstdlib/quick_exit.md index 94c03223a7..7579a4b93f 100644 --- a/reference/cstdlib/quick_exit.md +++ b/reference/cstdlib/quick_exit.md @@ -6,7 +6,7 @@ ```cpp namespace std { - [[noreturn]] void quick_exit(int status) noexcept; + [[noreturn]] void quick_exit(int status) noexcept; // (1) C++11 } ``` @@ -82,3 +82,7 @@ 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) +- [LWG Issue 1066. Use `[[noreturn]]` attribute in the library](https://cplusplus.github.io/LWG/issue1066) + - C++11で、呼び出し元へ戻らない標準ライブラリ関数に`[[noreturn]]`属性が付加された +- [LWG Issue 1264. `quick_exit` support for freestanding implementations](https://cplusplus.github.io/LWG/issue1264) + - C++11で、フリースタンディング処理系でもこの関数が提供されることが規定された From 7e520d81ec77fb1fec5bcc8edc9fa1a558e31f2c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 09:58:11 +0900 Subject: [PATCH 025/147] =?UTF-8?q?exception::what=20:=20=E3=82=B3?= =?UTF-8?q?=E3=83=94=E3=83=BC=E3=81=95=E3=82=8C=E3=81=9F=E4=BE=8B=E5=A4=96?= =?UTF-8?q?=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88=E3=81=8C?= =?UTF-8?q?=E5=90=8C=E3=81=98what=E6=96=87=E5=AD=97=E5=88=97=E3=82=92?= =?UTF-8?q?=E8=BF=94=E3=81=99=E3=81=93=E3=81=A8=E3=81=8C=E8=A6=8F=E5=AE=9A?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/exception/exception/what.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/reference/exception/exception/what.md b/reference/exception/exception/what.md index 888dd7ee67..80402d4178 100644 --- a/reference/exception/exception/what.md +++ b/reference/exception/exception/what.md @@ -15,9 +15,25 @@ constexpr const char* what() const noexcept override; // (1) C++26 エラー理由となる実装依存文字列を取得する。 +## 戻り値 +処理系定義のNULL終端マルチバイト文字列へのポインタを返す。 + +返されたポインタの指す文字列は、それを取得した例外オブジェクトを破棄するか、その例外オブジェクトに対して非`const`なメンバ関数を呼び出すまで有効である。 + + ## 例外 投げない +## 備考 +- C++11 : 動的な型が同じ`T`である2つのオブジェクト`lhs`と`rhs`について、`lhs`が`rhs`のコピーである場合、[`std::strcmp`](/reference/cstring/strcmp.md)`(lhs.what(), rhs.what()) == 0`が成り立つ + - この事後条件は、[`exception`](../exception.md)から派生する標準ライブラリのクラスすべてに要求される + + ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + +## 参照 +- [LWG Issue 471. result of `what()` implementation-defined](https://cplusplus.github.io/LWG/issue471) + - C++11で、コピーした例外オブジェクトの`what()`が元と同じ文字列を返すことが規定された。それ以前は「代入後に`what()`を呼び出した場合の効果は処理系定義」とされており、例外オブジェクトをコピーするとエラーメッセージが失われることが許されていた From 3f23c5adc1f4962767c6ae65e46a730eeabcaea1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 09:59:04 +0900 Subject: [PATCH 026/147] =?UTF-8?q?unexpected=20:=20C++11=E3=81=A7noreturn?= =?UTF-8?q?=E4=BB=98=E4=B8=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/exception/unexpected.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reference/exception/unexpected.md b/reference/exception/unexpected.md index f1dbff258a..e3f836fb63 100644 --- a/reference/exception/unexpected.md +++ b/reference/exception/unexpected.md @@ -7,7 +7,8 @@ ```cpp namespace std { - void unexpected(); + void unexpected(); // (1) C++98 + [[noreturn]] void unexpected(); // (1) C++11 } ``` @@ -51,3 +52,5 @@ unexpected handler called ## 参照 - [C++17 非推奨だった古い例外仕様を削除](/lang/cpp17/remove_deprecated_exception_specifications.md) +- [LWG Issue 1066. Use `[[noreturn]]` attribute in the library](https://cplusplus.github.io/LWG/issue1066) + - C++11で、呼び出し元へ戻らない標準ライブラリ関数に`[[noreturn]]`属性が付加された From ae04579300709bb446ade814810c1a69aa98bc29 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 09:59:23 +0900 Subject: [PATCH 027/147] =?UTF-8?q?terminate=20:=20C++98=E3=81=A8C++11?= =?UTF-8?q?=E3=81=A7=E5=AE=A3=E8=A8=80=E3=82=92=E5=88=86=E3=81=91=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/exception/terminate.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reference/exception/terminate.md b/reference/exception/terminate.md index c46df3c16f..7597767bc7 100644 --- a/reference/exception/terminate.md +++ b/reference/exception/terminate.md @@ -5,7 +5,8 @@ ```cpp namespace std { - [[noreturn]] void terminate() noexcept; + void terminate(); // (1) C++98 + [[noreturn]] void terminate() noexcept; // (1) C++11 } ``` @@ -85,6 +86,8 @@ terminate called without an active exception - [`set_terminate`](set_terminate.md) - `terminate`が呼び出される状況 - N3337 15.5.1 The `std::terminate()` function `[except.terminal]` +- [LWG Issue 1066. Use `[[noreturn]]` attribute in the library](https://cplusplus.github.io/LWG/issue1066) + - C++11で、呼び出し元へ戻らない標準ライブラリ関数に`[[noreturn]]`属性が付加された - [LWG Issue 2111. Which unexpected/terminate handler is called from the exception handling runtime?](https://cplusplus.github.io/LWG/issue2111) - 例外がアクティブな状態でハンドラが変更された場合、どのハンドラが呼び出されるかは未規定と明確化された - この修正は欠陥報告(DR)であり、C++11以降に遡及して適用される。もともと処理系(Itanium ABI等)の実際の挙動が分かれていた領域を未規定として追認したものであり、規定の変更によって処理系の挙動が変わるわけではないため From 21efc9fbddf4c882ed2bd1c9a683cc2bbe6084c8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:00:32 +0900 Subject: [PATCH 028/147] =?UTF-8?q?uncaught=5Fexception=20:=20=E7=8F=BE?= =?UTF-8?q?=E5=9C=A8=E3=81=AE=E3=82=B9=E3=83=AC=E3=83=83=E3=83=89=E3=81=8C?= =?UTF-8?q?=E5=AF=BE=E8=B1=A1=E3=81=A7=E3=81=82=E3=82=8B=E3=81=93=E3=81=A8?= =?UTF-8?q?=E3=81=8C=E6=98=8E=E8=A8=98=E3=81=95=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/exception/uncaught_exception.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/exception/uncaught_exception.md b/reference/exception/uncaught_exception.md index 3931d45a9e..2815b54f99 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`を返す。 @@ -67,3 +67,5 @@ catch - [GotW #47 Uncaught Exceptions](http://www.gotw.ca/gotw/047.htm) - [CWG Issue 475. When is `std::uncaught_exception()` true? (take 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#475) - [P0619R4 Reviewing deprecated facilities of C++17 for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0619r4.html) +- [LWG Issue 1368. Thread safety of `std::uncaught_exception()`](https://cplusplus.github.io/LWG/issue1368) + - C++11で、判定の対象が現在のスレッドであることが明記された。ほかのスレッドで例外が送出中であってもこの関数の結果に影響しない From ff90558a088f798b3b58d02c24bf0fa2395b7a01 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:00:56 +0900 Subject: [PATCH 029/147] =?UTF-8?q?=20:=20LWG=20Issue=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/exception/make_exception_ptr.md | 5 +++++ reference/exception/nested_exception/rethrow_nested.md | 4 ++++ reference/exception/rethrow_exception.md | 2 ++ reference/exception/rethrow_if_nested.md | 2 ++ reference/exception/throw_with_nested.md | 4 ++++ 5 files changed, 17 insertions(+) diff --git a/reference/exception/make_exception_ptr.md b/reference/exception/make_exception_ptr.md index 37d8b8c303..a8f7403d1d 100644 --- a/reference/exception/make_exception_ptr.md +++ b/reference/exception/make_exception_ptr.md @@ -91,3 +91,8 @@ exception_ptr make_exception_ptr(E e) noexcept ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + +## 参照 +- [LWG Issue 1130. `copy_exception` name misleading](https://cplusplus.github.io/LWG/issue1130) + - C++11で、関数名が`copy_exception`から`make_exception_ptr`へ改められた。既存の[`exception_ptr`](exception_ptr.md)をコピーする関数であるかのように読めたため diff --git a/reference/exception/nested_exception/rethrow_nested.md b/reference/exception/nested_exception/rethrow_nested.md index d5d59f9565..952056cd5a 100644 --- a/reference/exception/nested_exception/rethrow_nested.md +++ b/reference/exception/nested_exception/rethrow_nested.md @@ -82,3 +82,7 @@ int main() ## 参照 - [P3842R2 A conservative fix for constexpr `uncaught_exceptions()` and `current_exception()`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2026/p3842r2.pdf) - C++26の策定中に`constexpr`が追加されたが、本提案文書により巻き戻された (C++29で再検討予定) +- [LWG Issue 1136. Incomplete specification of `nested_exception::rethrow_nested()`](https://cplusplus.github.io/LWG/issue1136) + - C++11で、[`nested_ptr()`](nested_ptr.md)がヌルポインタを返す場合に[`std::terminate()`](/reference/exception/terminate.md)を呼び出すことが規定された +- [LWG Issue 1216. LWG 1066 Incomplete?](https://cplusplus.github.io/LWG/issue1216) + - C++11で、この関数に`[[noreturn]]`属性が付加された diff --git a/reference/exception/rethrow_exception.md b/reference/exception/rethrow_exception.md index eb5938c515..e724dfa691 100644 --- a/reference/exception/rethrow_exception.md +++ b/reference/exception/rethrow_exception.md @@ -90,3 +90,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)文面を修正。 +- [LWG Issue 1066. Use `[[noreturn]]` attribute in the library](https://cplusplus.github.io/LWG/issue1066) + - C++11で、呼び出し元へ戻らない標準ライブラリ関数に`[[noreturn]]`属性が付加された diff --git a/reference/exception/rethrow_if_nested.md b/reference/exception/rethrow_if_nested.md index fbfd04b2b5..be9966b7a0 100644 --- a/reference/exception/rethrow_if_nested.md +++ b/reference/exception/rethrow_if_nested.md @@ -125,6 +125,8 @@ inner ## 参照 - [P3842R2 A conservative fix for constexpr `uncaught_exceptions()` and `current_exception()`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2026/p3842r2.pdf) - C++26の策定中に`constexpr`が追加されたが、本提案文書により巻き戻された (C++29で再検討予定) +- [LWG Issue 819. `rethrow_if_nested`](https://cplusplus.github.io/LWG/issue819) + - C++11で、効果が`e.rethrow_nested()`の直接呼び出しから、[`nested_exception`](nested_exception.md)への`dynamic_cast`を経由するものへ改められた。`E`が[`nested_exception`](nested_exception.md)を公開かつ非曖昧に継承している場合にのみ動作させるため - [LWG Issue 2484. `rethrow_if_nested()` is doubly unimplementable](https://cplusplus.github.io/LWG/issue2484) - 型`E`が多相的でない場合は何もしないこと、および`e`の静的型が[`nested_exception`](nested_exception.md)であるかそこからpublicかつ曖昧さなく派生している場合を対象とすることが規定された - この修正は欠陥報告(DR)であり、C++11以降に遡及して適用される。 C++11時点の規定は「`e`の動的型が`nested_exception`から派生しているか」で判定するとしていたが、非多相なクラス型では動的型を判別する`dynamic_cast`自体が不適格となるため、規定どおりに実装することが不可能だった。したがって処理系は当初からこの修正後の挙動(非多相型では何もしない)を採るしかなく、これと異なる観測可能な挙動が出荷されていたわけではない diff --git a/reference/exception/throw_with_nested.md b/reference/exception/throw_with_nested.md index 786a1f69e5..e3d8d82ba4 100644 --- a/reference/exception/throw_with_nested.md +++ b/reference/exception/throw_with_nested.md @@ -123,6 +123,10 @@ inner ## 参照 - [P3842R2 A conservative fix for constexpr `uncaught_exceptions()` and `current_exception()`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2026/p3842r2.pdf) - C++26の策定中に`constexpr`が追加されたが、本提案文書により巻き戻された (C++29で再検討予定) +- [LWG Issue 1066. Use `[[noreturn]]` attribute in the library](https://cplusplus.github.io/LWG/issue1066) + - C++11で、呼び出し元へ戻らない標準ライブラリ関数に`[[noreturn]]`属性が付加された +- [LWG Issue 1370. `throw_with_nested` should not use perfect forwarding](https://cplusplus.github.io/LWG/issue1370) + - C++11で、要件と送出される例外の型の判定が`T`ではなく[`remove_reference`](/reference/type_traits/remove_reference.md)`::type`に対して行われるよう改められた。完全転送のために`T`が参照型となりうるため - [LWG Issue 2483. `throw_with_nested()` should use `is_final`](https://cplusplus.github.io/LWG/issue2483) - ラップするかどうかの判定に[`is_final`](/reference/type_traits/is_final.md)による条件が追加され、`final`指定されたクラスも引数に取れるようになった - この修正は欠陥報告(DR)であり、C++11以降に遡及して適用される。`final`指定されたクラスから派生した型を送出するという元の規定は実装不可能であり、処理系は当初から派生させずにそのまま送出していたため、これと異なる観測可能な挙動が出荷されていたわけではない From 955d576412a4b743869748b2c1f9543581730776 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:01:26 +0900 Subject: [PATCH 030/147] =?UTF-8?q?function=20:=20LWG=20Issue=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/functional/function.md | 2 ++ reference/functional/function/assign.md | 2 ++ reference/functional/function/op_assign.md | 2 ++ reference/functional/function/op_call.md | 2 ++ reference/functional/function/op_constructor.md | 10 ++++++++-- 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/reference/functional/function.md b/reference/functional/function.md index 9bf423996b..11ec279846 100644 --- a/reference/functional/function.md +++ b/reference/functional/function.md @@ -130,3 +130,5 @@ int main() - [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) - [P0619R4 Reviewing deprecated facilities of C++17 for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0619r4.html) +- [LWG Issue 1240. Deleted comparison functions of `std::function` not needed](https://cplusplus.github.io/LWG/issue1240) + - C++11で、`delete`定義されていた`operator==`/`operator!=`のメンバ宣言が削除された。`explicit operator bool()`によって`bool`への意図しない暗黙変換が起きなくなったため、比較を禁止する宣言が不要になった diff --git a/reference/functional/function/assign.md b/reference/functional/function/assign.md index e7009e891a..b8de55fb0d 100644 --- a/reference/functional/function/assign.md +++ b/reference/functional/function/assign.md @@ -75,4 +75,6 @@ int main() ## 参照 - [N2308 Adding allocator support to `std::function` for C++0x](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2308.html) - [P0302R1 Removing Allocator Support in `std::function` (rev 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0302r1.html) +- [LWG Issue 1288. `std::function` assignment from rvalues](https://cplusplus.github.io/LWG/issue1288) + - C++11で、関数オブジェクトを右辺値参照で受け取り、完全転送するようになった。ムーブのみ可能な引数を渡せるようにするため - [LWG Issue 2385. `function::assign` allocator argument doesn't make sense](https://wg21.cmeerw.net/lwg/issue2385) diff --git a/reference/functional/function/op_assign.md b/reference/functional/function/op_assign.md index 4c5f11bef1..999a5b3d45 100644 --- a/reference/functional/function/op_assign.md +++ b/reference/functional/function/op_assign.md @@ -76,5 +76,7 @@ int main() ## 参照 +- [LWG Issue 1288. `std::function` assignment from rvalues](https://cplusplus.github.io/LWG/issue1288) + - C++11で、関数オブジェクトを右辺値参照で受け取り、完全転送するようになった。ムーブのみ可能な引数を渡せるようにするため - [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_call.md b/reference/functional/function/op_call.md index e8e0bd2624..5c8088288b 100644 --- a/reference/functional/function/op_call.md +++ b/reference/functional/function/op_call.md @@ -62,3 +62,5 @@ int main() ## 参照 +- [LWG Issue 1333. Missing forwarding during `std::function` invocation](https://cplusplus.github.io/LWG/issue1333) + - C++11で、引数を[`std::forward`](/reference/utility/forward.md)によって完全転送することが規定された。右辺値参照の引数を持つシグニチャで、値がコピーされてしまっていたため diff --git a/reference/functional/function/op_constructor.md b/reference/functional/function/op_constructor.md index da32bd6d9c..50ba56a521 100644 --- a/reference/functional/function/op_constructor.md +++ b/reference/functional/function/op_constructor.md @@ -294,11 +294,18 @@ int main() ## 参照 - [N2308 Adding allocator support to `std::function` for C++0x](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2308.html) +- [LWG Issue 1287. `std::function` requires CopyConstructible target object](https://cplusplus.github.io/LWG/issue1287) + - C++11で、関数オブジェクト`F`がコピー構築可能であることが要件として明記された。このクラス自体がコピー可能であるため、保持する関数オブジェクトもコピー可能である必要がある +- [P0302R1 Removing Allocator Support in `std::function` (rev 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0302r1.html) +- [LWG Issue 1292. `std::function` should support all callable types](https://cplusplus.github.io/LWG/issue1292) + - C++11で、事後条件がヌルのメンバポインタ全般を含むよう整理され、対象オブジェクトが`std::move(f)`で初期化されることが規定された +- [LWG Issue 1399. function does not need an explicit default constructor](https://cplusplus.github.io/LWG/issue1399) + - C++11の策定時に、デフォルトコンストラクタから`explicit`が取り除かれた。引数を取らないコンストラクタに`explicit`を付ける意味がないため - [LWG Issue 2132. `std::function` ambiguity](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2132) - 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) - [LWG Issue 2393. `std::function`'s Callable definition is broken](https://cplusplus.github.io/LWG/issue2393) - C++17で、格納可能な要件が*Lvalue-Callable*(`INVOKE`を左辺値参照として行える型)として整理され、右辺値参照修飾の呼び出し演算子のみを持つ型は格納できないことが明確化された +- [P0771R1 std::function move constructor should be noexcept](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0771r1.pdf) - [LWG Issue 2565. `std::function`'s move constructor should guarantee nothrow for reference_wrappers and function pointers](https://cplusplus.github.io/LWG/issue2565) - C++17で、ムーブコンストラクタ(4)も、`reference_wrapper`か関数ポインタを保持する場合は例外を投げないことが規定された(コピーコンストラクタと同様の保証) - [LWG Issue 2774. `std::function` construction vs assignment](https://cplusplus.github.io/LWG/issue2774) @@ -306,7 +313,6 @@ int main() - [LWG Issue 2781. Contradictory requirements for `std::function` and `std::reference_wrapper`](https://cplusplus.github.io/LWG/issue2781) - 例外を投げない対象が「`reference_wrapper`の特殊化」である旨に文言が整理され、矛盾が解消された - この修正は欠陥報告(DR)であり、C++11以降に遡及して適用される。矛盾した文言の修正であり、処理系の挙動は変わらないため -- [P0771R1 std::function move constructor should be noexcept](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0771r1.pdf) - [LWG Issue 2850. `std::function` move constructor does unnecessary work](https://cplusplus.github.io/LWG/issue2850) - ムーブコンストラクタの効果が「`*this`のターゲットが構築前の`f`のターゲットと等価になる」旨に緩和され、別途確保されたターゲットの所有権移動による最適化が許容された - この修正は欠陥報告(DR)であり、C++11以降に遡及して適用される。元の規定は主要な処理系の実際の動作(ヒープ上のターゲットはポインタを移動するだけ)と矛盾しており、規定を実装に合わせたものであるため From d6a432af8c87a5b049d5660dacf15472ff33ce36 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:02:08 +0900 Subject: [PATCH 031/147] =?UTF-8?q?reference=5Fwrapper=20:=20LWG=20Issue?= =?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/functional/ref.md | 2 ++ reference/functional/reference_wrapper/op_call.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/reference/functional/ref.md b/reference/functional/ref.md index 2795efeb70..7696880b40 100644 --- a/reference/functional/ref.md +++ b/reference/functional/ref.md @@ -78,3 +78,5 @@ 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) +- [LWG Issue 688. `reference_wrapper`, `cref` unsafe, allow binding to rvalues](https://cplusplus.github.io/LWG/issue688) + - C++11で、`const`右辺値を受け取るオーバーロードが`delete`定義され、一時オブジェクトへの参照を保持してしまう誤用がコンパイルエラーになるようになった diff --git a/reference/functional/reference_wrapper/op_call.md b/reference/functional/reference_wrapper/op_call.md index 35fe67bb9b..fe6bbcc3f8 100644 --- a/reference/functional/reference_wrapper/op_call.md +++ b/reference/functional/reference_wrapper/op_call.md @@ -80,5 +80,7 @@ int main() ## 参照 - [P0357R3 reference_wrapper for incomplete types](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0357r3.html) - テンプレートパラメータ`T`が完全型であるという要件が追加された経緯 +- [LWG Issue 2017. `std::reference_wrapper` makes incorrect usage of `std::result_of`](https://cplusplus.github.io/LWG/issue2017) + - C++11で、戻り値型の計算が[`result_of`](/reference/type_traits/result_of.md)``から[`result_of`](/reference/type_traits/result_of.md)``へ修正された。参照を保持して呼び出す実際の形と一致していなかった - [LWG Issue 3764. `reference_wrapper::operator()` should propagate `noexcept`](https://cplusplus.github.io/LWG/issue3764) - C++23で、`operator()`に`noexcept(is_nothrow_invocable_v)`が付加され、被参照の呼び出し可能物の`noexcept`性が伝播するようになった From 5933e1eafc72ea0f2d70e09ee479bf5f0dc57e0a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:02:29 +0900 Subject: [PATCH 032/147] =?UTF-8?q?reference=5Fwrapper=20:=20=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E3=81=B8=E3=81=AE=E5=8F=82=E7=85=A7=E3=82=82=E4=BF=9D?= =?UTF-8?q?=E6=8C=81=E3=81=A7=E3=81=8D=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C?= =?UTF-8?q?=E6=98=8E=E8=A8=98=E3=81=95=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/reference_wrapper.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reference/functional/reference_wrapper.md b/reference/functional/reference_wrapper.md index 8a6811f0ea..227a8af055 100644 --- a/reference/functional/reference_wrapper.md +++ b/reference/functional/reference_wrapper.md @@ -12,7 +12,7 @@ namespace std { ``` ## 概要 -`reference_wrapper`は、コピー・代入可能なオブジェクトとして持ちまわれる参照オブジェクトを提供する。コピー不可なクラス (例:`std::istream`) をポインタで保持する代わりに`reference_wrapper`で保持することができる。また、`reference_wrapper`クラスは、関数テンプレートに変数を参照として渡すためにも使用できる。 +`reference_wrapper`は、コピー・代入可能なオブジェクトとして持ちまわれる参照オブジェクトを提供する。オブジェクトへの参照だけでなく、関数への参照も保持できる。コピー不可なクラス (例:`std::istream`) をポインタで保持する代わりに`reference_wrapper`で保持することができる。また、`reference_wrapper`クラスは、関数テンプレートに変数を参照として渡すためにも使用できる。 C++17からは、このクラスは[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であると規定された。 また、C++20からは、テンプレートパラメーター`T`は不完全型をサポートしている。 @@ -151,3 +151,7 @@ my_struct& get_my_struct() - [N4277 TriviallyCopyable `reference_wrapper` (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4277.html) - [P0619R4 Reviewing deprecated facilities of C++17 for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0619r4.html) - [P0357R3 reference_wrapper for incomplete types](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0357r3.html) +- [LWG Issue 987. `reference_wrapper` and function types](https://cplusplus.github.io/LWG/issue987) + - C++11で、オブジェクトだけでなく関数への参照も保持できることが明記された。また、このクラスがコピー代入可能であることが明記された +- [LWG Issue 2022. `reference_wrapper`::`result_type` is underspecified](https://cplusplus.github.io/LWG/issue2022) + - C++11で、`T`が関数型である場合に`result_type`がその戻り値型となることが明記された From 89952c53a93c89f37eaa9e8a3ed9cfa92ed8ab9c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:02:55 +0900 Subject: [PATCH 033/147] =?UTF-8?q?bind=E9=96=A2=E4=BF=82=20:=20LWG=20Issu?= =?UTF-8?q?e=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/functional/bind.md | 4 +++- reference/functional/is_bind_expression.md | 2 ++ reference/functional/is_placeholder.md | 2 ++ reference/functional/placeholders.md | 4 +++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/reference/functional/bind.md b/reference/functional/bind.md index ca058697cc..82bd686719 100644 --- a/reference/functional/bind.md +++ b/reference/functional/bind.md @@ -117,5 +117,7 @@ int main() ## 参照 -- [LWG Issue 2021. Further incorrect usages of `result_of`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2021) +- [LWG Issue 817. `bind` needs to be moved](https://cplusplus.github.io/LWG/issue817) + - C++11で、`f`と束縛する引数を右辺値参照で受け取るようになり、ムーブのみ可能な関数オブジェクトや引数を渡せるようになった。あわせて、呼び出しラッパーに要求される要件がコピー構築可能からムーブ構築可能へ緩和された - [P1065R2 constexpr INVOKE](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1065r2.html) +- [LWG Issue 2021. Further incorrect usages of `result_of`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2021) diff --git a/reference/functional/is_bind_expression.md b/reference/functional/is_bind_expression.md index ec78f45da0..d2925b7157 100644 --- a/reference/functional/is_bind_expression.md +++ b/reference/functional/is_bind_expression.md @@ -60,3 +60,5 @@ int main() {} ## 参照 - [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) +- [LWG Issue 1071. `is_bind_expression` should derive from `integral_constant`](https://cplusplus.github.io/LWG/issue1071) + - C++11で、静的メンバ変数`value`を直接持つ形から、[`integral_constant`](/reference/type_traits/integral_constant.md)から派生する形へ改められた。ほかの型特性と扱いを揃えるため diff --git a/reference/functional/is_placeholder.md b/reference/functional/is_placeholder.md index da7d8597f4..24580e8e82 100644 --- a/reference/functional/is_placeholder.md +++ b/reference/functional/is_placeholder.md @@ -53,3 +53,5 @@ int main() {} ## 参照 - [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) +- [LWG Issue 1071. `is_bind_expression` should derive from `integral_constant`](https://cplusplus.github.io/LWG/issue1071) + - C++11で、静的メンバ変数`value`を直接持つ形から、[`integral_constant`](/reference/type_traits/integral_constant.md)から派生する形へ改められた。ほかの型特性と扱いを揃えるため diff --git a/reference/functional/placeholders.md b/reference/functional/placeholders.md index f030794336..de799a991e 100644 --- a/reference/functional/placeholders.md +++ b/reference/functional/placeholders.md @@ -43,5 +43,7 @@ C++20以降、それらのコンストラクタ及び代入演算子(定義さ - C++11 ## 参照 -- [LWG Issue 2488. Placeholders should be allowed and encouraged to be constexpr](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2488) +- [LWG Issue 922. §`[func.bind.place]` Number of placeholders](https://cplusplus.github.io/LWG/issue922) + - C++11で、処理系がサポートすべきプレースホルダーの数の推奨値 (10) が、処理系の制限の一覧に追加された - [P0607R0 Inline Variables for the Standard Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0607r0.html) +- [LWG Issue 2488. Placeholders should be allowed and encouraged to be constexpr](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2488) From 7976263b277f94f798160f9f761edbe97fc59bf3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:03:08 +0900 Subject: [PATCH 034/147] =?UTF-8?q?cref=20:=20LWG=20Issue=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/functional/cref.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/functional/cref.md b/reference/functional/cref.md index 21b6c3bb48..c61197e198 100644 --- a/reference/functional/cref.md +++ b/reference/functional/cref.md @@ -80,3 +80,5 @@ 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) +- [LWG Issue 688. `reference_wrapper`, `cref` unsafe, allow binding to rvalues](https://cplusplus.github.io/LWG/issue688) + - C++11で、`const`右辺値を受け取るオーバーロードが`delete`定義され、一時オブジェクトへの参照を保持してしまう誤用がコンパイルエラーになるようになった From 5343fb441c1f8aa5ab9367656d3b8fd3c90e86be Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:06:08 +0900 Subject: [PATCH 035/147] =?UTF-8?q?hash=20:=20=E6=A8=99=E6=BA=96=E3=83=A9?= =?UTF-8?q?=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA=E3=81=AEhash=E3=81=AF?= =?UTF-8?q?=E4=BE=8B=E5=A4=96=E9=80=81=E5=87=BA=E3=81=97=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=81=93=E3=81=A8=E3=81=8C=E8=A6=8F=E5=AE=9A=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/hash.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/functional/hash.md b/reference/functional/hash.md index e0bebd15a7..0c96905fda 100644 --- a/reference/functional/hash.md +++ b/reference/functional/hash.md @@ -38,6 +38,8 @@ namespace std { このクラスはそのものにデフォルトの定義は存在せず、ユーザーが任意の型で特殊化する際の要件を定義する。`hash`クラステンプレートを特殊化する場合、後述するメンバ関数を持たせる必要がある。 +``ヘッダおよび標準ライブラリが提供する`hash`の特殊化は、例外を送出しない。ユーザーが定義する特殊化には、例外を送出しないという要件はない。 + ### 基本型のハッシュサポート ``ヘッダでは、基本型に対する特殊化を提供する。 `std::string`などC++標準ライブラリ定義の型に対する特殊化は、対象型を定義する各種ヘッダファイルにて提供される。 @@ -216,3 +218,5 @@ found : 3 - [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) +- [LWG Issue 1332. Let Hash objects throw!](https://cplusplus.github.io/LWG/issue1332) + - C++11で、ハッシュ関数が例外を送出してはならないという要件が削除され、標準が提供する特殊化についてのみ例外を送出しないことが規定された。利用者定義のハッシュ関数が例外を送出できるようにするため From 6d70b57feaa0f5fe24322ac0f1b445c49540b159 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:06:41 +0900 Subject: [PATCH 036/147] =?UTF-8?q?future,=20shared=5Ffuture,=20packaged?= =?UTF-8?q?=5Ftask=20:=20LWG=20Issue=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/future/future/share.md | 2 ++ reference/future/future/wait_for.md | 2 ++ reference/future/future/wait_until.md | 2 ++ reference/future/packaged_task.md | 4 ++++ reference/future/packaged_task/op_call.md | 2 ++ reference/future/packaged_task/op_constructor.md | 8 ++++++-- reference/future/shared_future/wait_for.md | 2 ++ reference/future/shared_future/wait_until.md | 2 ++ 8 files changed, 22 insertions(+), 2 deletions(-) diff --git a/reference/future/future/share.md b/reference/future/future/share.md index c5070ef19c..5531ad1ec6 100644 --- a/reference/future/future/share.md +++ b/reference/future/future/share.md @@ -97,5 +97,7 @@ int main() [futureとshared_future - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20120201/p1) [future::share()は何のためにあるのか - Faith and Brave - C++で遊ぼう](http://d.hatena.ne.jp/faith_and_brave/20121029/1351494001) +- [LWG Issue 2031. `std::future<>`::`share()` only applies to rvalues](https://cplusplus.github.io/LWG/issue2031) + - C++11で、右辺値参照修飾 (`&&`) が削除された。`auto f = p.get_future(); auto sf = f.share();`のように、名前を持つ`future`から直接呼び出せるようにするため - [LWG Issue 2556. Wide contract for `future::share()`](https://cplusplus.github.io/LWG/issue2556) - C++17で、`share()`が広い契約(`valid()`が`false`でも呼び出し可)を持ち例外を投げないことを反映して`noexcept`が付与された diff --git a/reference/future/future/wait_for.md b/reference/future/future/wait_for.md index 4b6a5d963c..59030fb87d 100644 --- a/reference/future/future/wait_for.md +++ b/reference/future/future/wait_for.md @@ -138,4 +138,6 @@ true ## 参照 +- [LWG Issue 1518. Waiting for deferred functions](https://cplusplus.github.io/LWG/issue1518) + - C++11で、遅延実行の関数を持つ共有状態に対してはブロッキングせず、[`future_status::deferred`](/reference/future/future_status.md)を返すことが規定された - [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 a3b918a7bf..c7d41c5af5 100644 --- a/reference/future/future/wait_until.md +++ b/reference/future/future/wait_until.md @@ -105,4 +105,6 @@ int main() ## 参照 +- [LWG Issue 1518. Waiting for deferred functions](https://cplusplus.github.io/LWG/issue1518) + - C++11で、遅延実行の関数を持つ共有状態に対してはブロッキングせず、[`future_status::deferred`](/reference/future/future_status.md)を返すことが規定された - [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/packaged_task.md b/reference/future/packaged_task.md index 7ca367acaf..0e2bdd880c 100644 --- a/reference/future/packaged_task.md +++ b/reference/future/packaged_task.md @@ -130,3 +130,7 @@ int main() ## 参照 +- [LWG Issue 2000. Missing definition of `packaged_task` specialization of `uses_allocator`](https://cplusplus.github.io/LWG/issue2000) + - C++11で、[`uses_allocator`](/reference/memory/uses_allocator.md)の特殊化が[`true_type`](/reference/type_traits/true_type.md)から派生することが規定された。宣言のみで内容が規定されていなかった +- [LWG Issue 2030. `packaged_task::result_type` should be removed](https://cplusplus.github.io/LWG/issue2030) + - C++11で、メンバ型`result_type`が削除された。関数オブジェクトとしての慣習に従ったものだったが、このクラスは直接呼び出して値を返すものではないため diff --git a/reference/future/packaged_task/op_call.md b/reference/future/packaged_task/op_call.md index 449a1722a2..0251fb0f52 100644 --- a/reference/future/packaged_task/op_call.md +++ b/reference/future/packaged_task/op_call.md @@ -104,5 +104,7 @@ error! ## 参照 +- [LWG Issue 2008. Conflicting Error Conditions for `packaged_task::operator()`](https://cplusplus.github.io/LWG/issue2008) + - C++11で、`promise_already_satisfied`を送出する条件が「共有状態がすでに準備完了である」から「格納されたタスクがすでに実行された」へ改められた。前者では、タスクの実行完了前に共有状態が準備完了になる状況と条件が食い違っていた - [LWG Issue 2142. `packaged_task::operator()` synchronization too broad?](https://cplusplus.github.io/LWG/issue2142) - C++14で、この関数についての同期の規定が削除された。「`future`や`shared_future`のあらゆるメンバ関数の呼び出しと同期する」という規定は、タイムアウトで戻る[`wait_for()`](../future/wait_for.md)や[`wait_until()`](../future/wait_until.md)まで含んでしまい広すぎたため。共有状態そのものの規定で必要な同期は既に保証されている diff --git a/reference/future/packaged_task/op_constructor.md b/reference/future/packaged_task/op_constructor.md index 2d99eee502..a976b1dd20 100644 --- a/reference/future/packaged_task/op_constructor.md +++ b/reference/future/packaged_task/op_constructor.md @@ -116,14 +116,18 @@ int main() ## 参照 +- [LWG Issue 1514. `packaged_task` constructors need review](https://cplusplus.github.io/LWG/issue1514) + - C++11で、関数オブジェクトを右辺値参照で受け取る形へ改められ、関数ポインタ専用のオーバーロードが削除された。ムーブのみ可能な関数オブジェクトを渡せるようにするため +- [LWG Issue 2027. Initialization of the stored task of a `packaged_task`](https://cplusplus.github.io/LWG/issue2027) + - C++11で、保持するタスクが`f`のコピーではなく[`std::forward`](/reference/utility/forward.md)`(f)`で初期化されることが規定された - [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) - [LWG Issue 2097. `packaged_task` constructors should be constrained](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2097) +- [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でアロケータを受け取るコンストラクタを再追加 - [LWG Issue 2752. Throws: clauses of `async` and `packaged_task` are unimplementable](https://cplusplus.github.io/LWG/issue2752) - C++17で、アロケータを取る版において、アロケータの`allocate`から送出される例外も例外指定に加えられた(`f`のコピー/ムーブ構築や`bad_alloc`はC++14で既に規定済み)。なおアロケータを取る版自体はLWG 2976 (C++20)で削除された - [LWG Issue 2921. `packaged_task` and type-erased allocators](https://wg21.cmeerw.net/lwg/issue2921) - [`std::function`のコンストラクタ](/reference/functional/function/op_constructor.md)と同様の理由により、アロケータを受け取るコンストラクタを削除 -- [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でアロケータを受け取るコンストラクタを再追加 - [LWG Issue 3039. Unnecessary `decay` in `thread` and `packaged_task`](https://wg21.cmeerw.net/lwg/issue3039) - [LWG Issue 4154. The Mandates for `std::packaged_task`'s constructor from a callable entity should consider decaying](https://cplusplus.github.io/LWG/issue4154) - C++26で、適格要件が`is_invocable_r_v`から`is_invocable_r_v&, ArgTypes...>`に修正された(`F`をdecayした型で判定する) diff --git a/reference/future/shared_future/wait_for.md b/reference/future/shared_future/wait_for.md index b61b880f19..9732aa0a8c 100644 --- a/reference/future/shared_future/wait_for.md +++ b/reference/future/shared_future/wait_for.md @@ -89,4 +89,6 @@ int main() ## 参照 +- [LWG Issue 1518. Waiting for deferred functions](https://cplusplus.github.io/LWG/issue1518) + - C++11で、遅延実行の関数を持つ共有状態に対してはブロッキングせず、[`future_status::deferred`](/reference/future/future_status.md)を返すことが規定された - [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 7540cb8fd6..9a0c10ca30 100644 --- a/reference/future/shared_future/wait_until.md +++ b/reference/future/shared_future/wait_until.md @@ -99,4 +99,6 @@ int main() ## 参照 +- [LWG Issue 1518. Waiting for deferred functions](https://cplusplus.github.io/LWG/issue1518) + - C++11で、遅延実行の関数を持つ共有状態に対してはブロッキングせず、[`future_status::deferred`](/reference/future/future_status.md)を返すことが規定された - [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) From e76395de716ab7a8b3e74c9e6eb81866a7cc88ff Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:15:06 +0900 Subject: [PATCH 037/147] =?UTF-8?q?basic=5Fios=20:=20C++98=E3=81=A8C++11?= =?UTF-8?q?=E4=BB=95=E6=A7=98=E3=82=92=E6=9B=B8=E3=81=8D=E5=88=86=E3=81=91?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ios/basic_ios/clear.md | 14 +++++++++----- reference/ios/basic_ios/move.md | 6 ++++-- reference/ios/basic_ios/op_assign.md | 4 ++-- reference/ios/basic_ios/op_bool.md | 4 +++- reference/ios/basic_ios/op_constructor.md | 8 ++++---- reference/ios/basic_ios/op_destructor.md | 2 +- reference/ios/basic_ios/op_voidptr.md | 4 ++-- reference/ios/basic_ios/rdbuf.md | 6 +++--- reference/ios/basic_ios/set_rdbuf.md | 4 +++- 9 files changed, 31 insertions(+), 21 deletions(-) diff --git a/reference/ios/basic_ios/clear.md b/reference/ios/basic_ios/clear.md index 9fd2f5d4cb..f62362f6c8 100644 --- a/reference/ios/basic_ios/clear.md +++ b/reference/ios/basic_ios/clear.md @@ -5,7 +5,7 @@ * function[meta id-type] ```cpp -void clear(iostate state = goodbit); +void clear(iostate state = goodbit); // (1) C++98 ``` * iostate[link ../ios_base/type-iostate.md] * goodbit[link ../ios_base/type-iostate.md] @@ -15,17 +15,21 @@ void clear(iostate state = goodbit); ## 効果 状態値を`state`にする。 -ただし、[`rdbuf`](rdbuf.md)`() == nullptr`であれば、さらに[`ios_base`](../ios_base.md)`::`[`badbit`](../ios_base/type-iostate.md)をビットORした値にする。 +ただし、[`rdbuf`](rdbuf.md)`()`がヌルポインタであれば、さらに[`ios_base`](../ios_base.md)`::`[`badbit`](../ios_base/type-iostate.md)をビットORした値にする。 ## 例外 -変更後の状態値のビットと[`exceptions`](exceptions.md)`()`で設定した値でビットごとのANDを行って非0になれば、[`ios_base`](../ios_base.md)`::`[`failure`](../ios_base/failure.md)型の例外を送出する。 -その際、[`ios_base`](../ios_base.md)`::`[`failure`](../ios_base/failure.md)の[コンストラクタ](../ios_base/failure/op_constructor.md)に渡される引数は、処理系定義である。 +変更後の状態値のビットと[`exceptions`](exceptions.md)`()`で設定した値でビットごとのANDを行って非0になれば、[`ios_base`](../ios_base.md)`::`[`failure`](../ios_base/failure.md)型の例外を送出する。 + +送出する例外オブジェクトの構築方法は、以下のように規定されている。 + +- C++98 : 規定されていない +- C++11 : [`ios_base`](../ios_base.md)`::`[`failure`](../ios_base/failure.md)の[コンストラクタ](../ios_base/failure/op_constructor.md)に渡される引数は、処理系定義である ## 実装例 ```cpp void clear(iostate state = goodbit) { - iostate newstate = rdbuf() != nullptr + iostate newstate = rdbuf() != 0 ? state : state | badbit; diff --git a/reference/ios/basic_ios/move.md b/reference/ios/basic_ios/move.md index 816b2f1893..f7227033f6 100644 --- a/reference/ios/basic_ios/move.md +++ b/reference/ios/basic_ios/move.md @@ -7,9 +7,9 @@ ```cpp protected: - void move(basic_ios& rhs); + void move(basic_ios& rhs); // (1) C++11 - void move(basic_ios&& rhs); + void move(basic_ios&& rhs); // (2) C++11 ``` * basic_ios[link ../basic_ios.md] @@ -34,3 +34,5 @@ protected: ## 参照 - [`basic_ios`](../basic_ios.md)`::`[`swap`](swap.md) +- [LWG Issue 1104. `basic_ios::move` should accept lvalues](https://cplusplus.github.io/LWG/issue1104) + - C++11で、左辺値を受け取るオーバーロードが追加された。派生クラスのムーブコンストラクタから、基底クラスの部分オブジェクトを名前で渡せるようにするため diff --git a/reference/ios/basic_ios/op_assign.md b/reference/ios/basic_ios/op_assign.md index 13719af2f4..5e4024cdb9 100644 --- a/reference/ios/basic_ios/op_assign.md +++ b/reference/ios/basic_ios/op_assign.md @@ -6,9 +6,9 @@ ```cpp private: - basic_ios& operator=(const basic_ios&); // 宣言のみ、C++98 まで + basic_ios& operator=(const basic_ios&); // (1) C++98 宣言のみ public: - basic_ios& operator=(const basic_ios&) = delete; // C++11 から + basic_ios& operator=(const basic_ios&) = delete; // (1) C++11 ``` diff --git a/reference/ios/basic_ios/op_bool.md b/reference/ios/basic_ios/op_bool.md index 999f01e399..2e3ec18ab8 100644 --- a/reference/ios/basic_ios/op_bool.md +++ b/reference/ios/basic_ios/op_bool.md @@ -6,7 +6,7 @@ * cpp11[meta cpp] ```cpp -explicit operator bool() const; +explicit operator bool() const; // (1) C++11 ``` ## 概要 @@ -54,3 +54,5 @@ libc++ では C++03 モードでも本関数が使用可能である。(ただ - `operator bool`(この関数) - [`operator void*`](op_voidptr.md) - [`operator!`](op_not.md) +- [LWG Issue 1094. Replace "unspecified-bool-type" by "explicit operator `bool()` const" in I/O library](https://cplusplus.github.io/LWG/issue1094) + - C++11で、未規定のbool型への変換関数が`explicit operator bool()`へ置き換えられた diff --git a/reference/ios/basic_ios/op_constructor.md b/reference/ios/basic_ios/op_constructor.md index 1140120eed..be127333fe 100644 --- a/reference/ios/basic_ios/op_constructor.md +++ b/reference/ios/basic_ios/op_constructor.md @@ -6,15 +6,15 @@ ```cpp public: - explicit basic_ios(basic_streambuf* sb); // (1) + explicit basic_ios(basic_streambuf* sb); // (1) C++98 protected: - basic_ios(); // (2) + basic_ios(); // (2) C++98 private: - basic_ios(basic_ios&); // (3) 宣言のみ、C++98 まで + basic_ios(basic_ios&); // (3) C++98 宣言のみ public: - basic_ios(basic_ios&) = delete; // (3) C++11 から + basic_ios(basic_ios&) = delete; // (3) C++11 ``` diff --git a/reference/ios/basic_ios/op_destructor.md b/reference/ios/basic_ios/op_destructor.md index 6473b83ab0..f97eda7ffd 100644 --- a/reference/ios/basic_ios/op_destructor.md +++ b/reference/ios/basic_ios/op_destructor.md @@ -5,7 +5,7 @@ * function[meta id-type] ```cpp -~basic_ios(); +virtual ~basic_ios(); // (1) C++98 ``` diff --git a/reference/ios/basic_ios/op_voidptr.md b/reference/ios/basic_ios/op_voidptr.md index c440c29044..159cfec6ca 100644 --- a/reference/ios/basic_ios/op_voidptr.md +++ b/reference/ios/basic_ios/op_voidptr.md @@ -6,7 +6,7 @@ * cpp11removed[meta cpp] ```cpp -operator void*() const; +operator void*() const; // (1) C++98 ``` ## 概要 @@ -28,7 +28,7 @@ operator void*() const; ## 実装例 ```cpp -explicit operator void*() const { +operator void*() const { return fail() ? NULL : const_cast(this); } ``` diff --git a/reference/ios/basic_ios/rdbuf.md b/reference/ios/basic_ios/rdbuf.md index 82ac9860b6..03d3c6ac1b 100644 --- a/reference/ios/basic_ios/rdbuf.md +++ b/reference/ios/basic_ios/rdbuf.md @@ -5,9 +5,9 @@ * function[meta id-type] ```cpp -basic_streambuf* rdbuf() const; // (1) +basic_streambuf* rdbuf() const; // (1) C++98 -basic_streambuf* rdbuf(basic_streambuf* sb); // (2) +basic_streambuf* rdbuf(basic_streambuf* sb); // (2) C++98 ``` * basic_streambuf[link ../../streambuf/basic_streambuf.md] @@ -17,7 +17,7 @@ basic_streambuf* rdbuf(basic_streambuf* sb); ## 効果 - (1) - - (2) `*this` に紐づくストリームバッファ([`basic_streambuf`](../../streambuf/basic_streambuf.md))オブジェクトを引数 `sb` に設定する(`rdbuf() == sb` となる)。 - その後、[`clear`](clear.md)`()` を実行する(結果として、`sb == nullptr`、かつ、`(`[`exceptions`](exceptions.md)`() &` [`ios_base`](../ios_base.md)`::`[`badbit`](../ios_base/type-iostate.md)`) != 0` の場合、[`ios_base`](../ios_base.md)`::`[`failure`](../ios_base/failure.md) 例外が送出される)。 + その後、[`clear`](clear.md)`()` を実行する(結果として、`sb`がヌルポインタであり、かつ、`(`[`exceptions`](exceptions.md)`() &` [`ios_base`](../ios_base.md)`::`[`badbit`](../ios_base/type-iostate.md)`) != 0` の場合、[`ios_base`](../ios_base.md)`::`[`failure`](../ios_base/failure.md) 例外が送出される)。 ## 戻り値 - (1) `*this` に紐づいているストリームバッファ([`basic_streambuf`](../../streambuf/basic_streambuf.md))オブジェクトへのポインタ diff --git a/reference/ios/basic_ios/set_rdbuf.md b/reference/ios/basic_ios/set_rdbuf.md index b7f36d76ab..3635c315df 100644 --- a/reference/ios/basic_ios/set_rdbuf.md +++ b/reference/ios/basic_ios/set_rdbuf.md @@ -7,7 +7,7 @@ ```cpp protected: - void set_rdbuf(basic_streambuf* sb); + void set_rdbuf(basic_streambuf* sb); // (1) C++11 ``` * basic_streambuf[link ../../streambuf/basic_streambuf.md] @@ -40,3 +40,5 @@ protected: ## 参照 - [`rdbuf`](rdbuf.md) +- [LWG Issue 1183. `basic_ios::set_rdbuf` may break class invariants](https://cplusplus.github.io/LWG/issue1183) + - C++11で、`sb`がヌルポインタでないという要件が追加された。ヌルポインタを設定すると、[`clear()`](clear.md)を呼ばないこの関数ではエラー状態が更新されず、クラス不変条件が壊れるため From e75a02c0a8ea7890596d55b97da1a54d93e680f6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:15:30 +0900 Subject: [PATCH 038/147] =?UTF-8?q?ios=5Fbase=20:=20LWG=20Issue=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/ios/ios_base/Init.md | 5 +++++ reference/ios/ios_base/op_constructor.md | 2 ++ 2 files changed, 7 insertions(+) diff --git a/reference/ios/ios_base/Init.md b/reference/ios/ios_base/Init.md index 7fe5ff790b..d5d3fd00c3 100644 --- a/reference/ios/ios_base/Init.md +++ b/reference/ios/ios_base/Init.md @@ -49,3 +49,8 @@ namespace std { - [`wcout`](../../iostream/wcout.md) - [`wcerr`](../../iostream/wcerr.md.nolink) - [`wclog`](../../iostream/wclog.md.nolink) + + +## 参照 +- [LWG Issue 1123. No requirement that standard streams be flushed](https://cplusplus.github.io/LWG/issue1123) + - C++11で、[``](../../iostream.md)をインクルードした翻訳単位が、静的記憶域期間の`ios_base::Init`型オブジェクトを定義しているかのように振る舞うと規定された。以前は初期化順序のみが規定されており、標準ストリームがフラッシュされることが保証されていなかった diff --git a/reference/ios/ios_base/op_constructor.md b/reference/ios/ios_base/op_constructor.md index 731f0704d8..9eb67dee46 100644 --- a/reference/ios/ios_base/op_constructor.md +++ b/reference/ios/ios_base/op_constructor.md @@ -52,3 +52,5 @@ public: - [`basic_ios`](../basic_ios.md) - [`basic_ios`](../basic_ios.md)`::`[`basic_ios`](../basic_ios/op_constructor.md) - [`basic_ios`](../basic_ios.md)`::`[`init`](../basic_ios/init.md) +- [LWG Issue 1249. `basic_ios` default ctor](https://cplusplus.github.io/LWG/issue1249) + - C++11で、[`init()`](../basic_ios/init.md)による初期化を行わなければならない期限が「初めて使用する時かデストラクタが呼ばれる時のいずれか早い方の前まで」と明確化された From ca61866b717d5ba1a29cfa52f6d8c3779a40af3a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:15:42 +0900 Subject: [PATCH 039/147] =?UTF-8?q?io=5Ferrc=20:=20LWG=20Issue=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/ios/io_errc.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/ios/io_errc.md b/reference/ios/io_errc.md index c0c6fcde74..67cf21d083 100644 --- a/reference/ios/io_errc.md +++ b/reference/ios/io_errc.md @@ -48,3 +48,5 @@ namespace std { - [`error_code`](../system_error/error_code.md) - [`error_code`](../system_error/error_code.md)`::`[`error_code`](../system_error/error_code/op_constructor.md) - [`ios_base`](ios_base.md)`::`[`failure`](ios_base/failure.md) +- [LWG Issue 1257. Header `` still contains a `concept_map`](https://cplusplus.github.io/LWG/issue1257) + - C++11で、コンセプトマップによる指定が[`is_error_code_enum`](/reference/system_error/is_error_code_enum.md)の特殊化へ置き換えられた。コンセプトがC++11から削除されたため From 70b1f156fbe71841305eced44ec4ecfdc35e17f7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:16:05 +0900 Subject: [PATCH 040/147] =?UTF-8?q?iosfwd::wstreampos=20:=20LWG=20Issue?= =?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/iosfwd/type-wstreampos.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/iosfwd/type-wstreampos.md b/reference/iosfwd/type-wstreampos.md index dc51c28330..ed94dae5e1 100644 --- a/reference/iosfwd/type-wstreampos.md +++ b/reference/iosfwd/type-wstreampos.md @@ -19,3 +19,8 @@ namespace std { ## 関連項目 - [`fpos`](/reference/ios/fpos.md): ストリーム上の位置を表現するクラステンプレート - [`streampos`](type-streampos.md): `char`を要素とするストリーム上の位置を表す型 + + +## 参照 +- [LWG Issue 1414. Fixing remaining dead links to `POS_T` and `OFF_T`](https://cplusplus.github.io/LWG/issue1414) + - C++11で、この型が満たすべき要件の参照先が、存在しない`POS_T`から`pos_type`の規定へ修正された From 57b82c35231223e18f260bfd19fcb969ec69a20e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:26:24 +0900 Subject: [PATCH 041/147] =?UTF-8?q?basic=5Fistream,=20basic=5Fostream,=20b?= =?UTF-8?q?asic=5Fiostream=20:=20C++98=E3=81=A8C++11=E3=81=AE=E4=BB=95?= =?UTF-8?q?=E6=A7=98=E3=82=92=E6=9B=B8=E3=81=8D=E5=88=86=E3=81=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/istream/basic_iostream.md | 13 +++-- reference/istream/basic_iostream/op_assign.md | 50 ++++++++++++++++++ .../istream/basic_iostream/op_constructor.md | 46 +++++++++++++---- .../istream/basic_iostream/op_destructor.md | 29 +++++++++++ reference/istream/basic_iostream/swap.md | 43 ++++++++++++++++ reference/istream/basic_istream.md | 13 +++-- reference/istream/basic_istream/op_assign.md | 51 +++++++++++++++++++ .../istream/basic_istream/op_constructor.md | 41 +++++++++++++-- .../istream/basic_istream/op_destructor.md | 28 ++++++++++ reference/istream/basic_istream/op_istream.md | 4 ++ .../basic_istream/sentry/op_constructor.md | 5 ++ reference/istream/basic_istream/swap.md | 43 ++++++++++++++++ reference/ostream/basic_ostream.md | 9 +++- reference/ostream/basic_ostream/op_assign.md | 6 +-- .../ostream/basic_ostream/op_constructor.md | 8 +-- .../ostream/basic_ostream/op_destructor.md | 6 +-- reference/ostream/basic_ostream/swap.md | 4 +- 17 files changed, 360 insertions(+), 39 deletions(-) create mode 100644 reference/istream/basic_iostream/op_assign.md create mode 100644 reference/istream/basic_iostream/op_destructor.md create mode 100644 reference/istream/basic_iostream/swap.md create mode 100644 reference/istream/basic_istream/op_assign.md create mode 100644 reference/istream/basic_istream/op_destructor.md create mode 100644 reference/istream/basic_istream/swap.md diff --git a/reference/istream/basic_iostream.md b/reference/istream/basic_iostream.md index 78c5847f79..f674af374c 100644 --- a/reference/istream/basic_iostream.md +++ b/reference/istream/basic_iostream.md @@ -57,12 +57,13 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------------------------------------------|----------------|----------------| | [`(constructor)`](basic_iostream/op_constructor.md) | コンストラクタ | | -| `(destructor)` | デストラクタ | | -| `operator=` | ムーブ代入 | C++11 | -| `swap` | 値の交換 | C++11 | +| [`(destructor)`](basic_iostream/op_destructor.md) | デストラクタ | | +| [`operator=`](basic_iostream/op_assign.md) | ムーブ代入 | C++11 | +| [`swap`](basic_iostream/swap.md) | 値の交換 | C++11 | -- コピーコンストラクタとコピー代入演算子はdelete定義されている。 -- ムーブコンストラクタ・ムーブ代入演算子と`swap`はprotectedで定義されている。 +- コピーコンストラクタとコピー代入演算子は、アクセス指定子`protected`で`delete`定義されている。 + - C++98では、これらは宣言されていなかった。コピーしようとすると、基底クラスである[`basic_ios`](../ios/basic_ios.md)のコピーコンストラクタ・コピー代入演算子がアクセス指定子`private`で宣言されているため、エラーとなっていた。 +- ムーブコンストラクタ・ムーブ代入演算子と`swap`は、アクセス指定子`protected`で定義されている。 ## 参照 @@ -70,3 +71,5 @@ namespace std { - 基底クラス - [`ios_base`](../ios/ios_base.md) - [`basic_ios`](../ios/basic_ios.md) +- [LWG Issue 911. I/O streams and move/swap semantic](https://cplusplus.github.io/LWG/issue911) + - C++11で、ムーブコンストラクタ・ムーブ代入演算子・`swap`が`protected`となり、非メンバ関数の`swap`が削除された。派生クラスのみが使用でき、基底クラスのオブジェクトを直接ムーブ・交換できないようにするため diff --git a/reference/istream/basic_iostream/op_assign.md b/reference/istream/basic_iostream/op_assign.md new file mode 100644 index 0000000000..3e3b418156 --- /dev/null +++ b/reference/istream/basic_iostream/op_assign.md @@ -0,0 +1,50 @@ +# operator= +* istream[meta header] +* std[meta namespace] +* basic_iostream[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +protected: + basic_iostream& operator=(const basic_iostream& rhs) = delete; // (1) C++11 + + basic_iostream& operator=(basic_iostream&& rhs); // (2) C++11 +``` +* basic_iostream[link ../basic_iostream.md] + + +## 概要 +ストリームオブジェクトを代入する。 + + +## 効果 +- (1) : コピー代入演算子。コピー代入不可。 +- (2) : ムーブ代入演算子。[`swap`](swap.md)`(rhs)`を呼び出す。 + + +## 戻り値 +- (2) : `*this` + + +## 備考 +- (1) : + - C++98 : この演算子は宣言されていなかった。コピー代入を行おうとするとコンパイラがコピー代入演算子を暗黙に生成しようとするが、基底クラスの[`basic_ios`](../../ios/basic_ios.md)`::`[`operator=`](../../ios/basic_ios/op_assign.md)がアクセス指定子`private`で宣言されているため、エラーとなっていた + - C++11 : アクセス指定子`protected`で`delete`定義される。誤ってコピーしようとした際のエラーメッセージが分かりやすくなる +- (2) : [`rdbuf`](../../ios/basic_ios/rdbuf.md)`()`は交換されない。 + + +## バージョン +### 言語 +- C++11 + + +## 関連項目 +- [`basic_iostream`](../basic_iostream.md)`::`[`basic_iostream`](op_constructor.md) +- [`basic_iostream`](../basic_iostream.md)`::`[`swap`](swap.md) +- [`basic_istream`](../basic_istream.md)`::`[`operator=`](../basic_istream/op_assign.md) + + +## 参照 +- [LWG Issue 911. I/O streams and move/swap semantic](https://cplusplus.github.io/LWG/issue911) + - C++11で、ムーブコンストラクタ・ムーブ代入演算子・`swap`が`protected`となり、非メンバ関数の`swap`が削除された。派生クラスのみが使用でき、基底クラスのオブジェクトを直接ムーブ・交換できないようにするため diff --git a/reference/istream/basic_iostream/op_constructor.md b/reference/istream/basic_iostream/op_constructor.md index 752d75eb1d..7f4a780e74 100644 --- a/reference/istream/basic_iostream/op_constructor.md +++ b/reference/istream/basic_iostream/op_constructor.md @@ -2,27 +2,53 @@ * istream[meta header] * std[meta namespace] * basic_iostream[meta class] -* function template[meta id-type] +* function[meta id-type] ```cpp -explicit basic_iostream(basic_streambuf* sb); -basic_iostream(basic_iostream&& rhs); +public: + explicit basic_iostream(basic_streambuf* sb); // (1) C++98 + +protected: + basic_iostream(const basic_iostream& rhs) = delete; // (2) C++11 + + basic_iostream(basic_iostream&& rhs); // (3) C++11 ``` +* basic_iostream[link ../basic_iostream.md] +* basic_streambuf[link ../../streambuf/basic_streambuf.md] + ## 概要 -オブジェクトを構築する。 +入出力ストリームオブジェクトを構築する。 + +- (1) : ストリームバッファを受け取って構築する +- (2) : コピーコンストラクタ。コピー構築不可 +- (3) : ムーブコンストラクタ + ## 効果 -- ストリームバッファ`sb`を実引数として受け取るコンストラクタ - - 基底クラスのコンストラクタ呼び出しとして、`basic_istream(sb)`と`basic_ostream(sb)`を実行する。 -- ムーブコンストラクタ - - `basic_istream::move(std::move(rhs))`を呼び出す。 +- (1) : 基底クラスのコンストラクタ呼び出しとして、[`basic_istream`](../basic_istream.md)`(sb)`と[`basic_ostream`](../../ostream/basic_ostream.md)`(sb)`を実行する。 +- (3) : 基底クラスの[`basic_istream`](../basic_istream.md)``を`rhs`からムーブ構築する。 + + +## 備考 +- (2) : + - C++98 : このコンストラクタは宣言されていなかった。コピー構築を行おうとするとコンパイラがコピーコンストラクタを暗黙に生成しようとするが、基底クラスの[`basic_ios`](../../ios/basic_ios.md)のコピーコンストラクタがアクセス指定子`private`で宣言されているため、エラーとなっていた + - C++11 : アクセス指定子`protected`で`delete`定義される。誤ってコピーしようとした際のエラーメッセージが分かりやすくなる -## 実装例 ## バージョン ### 言語 - C++98 -- C++11: ムーブコンストラクタの追加 + + +## 関連項目 +- [`basic_iostream`](../basic_iostream.md)`::`[`~basic_iostream`](op_destructor.md) +- [`basic_iostream`](../basic_iostream.md)`::`[`operator=`](op_assign.md) +- [`basic_iostream`](../basic_iostream.md)`::`[`swap`](swap.md) +- [`basic_istream`](../basic_istream.md)`::`[`basic_istream`](../basic_istream/op_constructor.md) +- [`basic_ostream`](../../ostream/basic_ostream.md)`::`[`basic_ostream`](../../ostream/basic_ostream/op_constructor.md) + ## 参照 +- [LWG Issue 911. I/O streams and move/swap semantic](https://cplusplus.github.io/LWG/issue911) + - C++11で、ムーブコンストラクタ・ムーブ代入演算子・`swap`が`protected`となり、非メンバ関数の`swap`が削除された。派生クラスのみが使用でき、基底クラスのオブジェクトを直接ムーブ・交換できないようにするため diff --git a/reference/istream/basic_iostream/op_destructor.md b/reference/istream/basic_iostream/op_destructor.md new file mode 100644 index 0000000000..e00df624ee --- /dev/null +++ b/reference/istream/basic_iostream/op_destructor.md @@ -0,0 +1,29 @@ +# デストラクタ +* istream[meta header] +* std[meta namespace] +* basic_iostream[meta class] +* function[meta id-type] + +```cpp +virtual ~basic_iostream(); // (1) C++98 +``` +* basic_iostream[link ../basic_iostream.md] + + +## 概要 +入出力ストリームオブジェクトを破棄する。 + + +## 備考 +[`rdbuf`](../../ios/basic_ios/rdbuf.md)`()`に対する操作は、一切行わない。 + + +## バージョン +### 言語 +- C++98 + + +## 関連項目 +- [`basic_iostream`](../basic_iostream.md)`::`[`basic_iostream`](op_constructor.md) +- [`basic_istream`](../basic_istream.md)`::`[`~basic_istream`](../basic_istream/op_destructor.md) +- [`basic_ostream`](../../ostream/basic_ostream.md)`::`[`~basic_ostream`](../../ostream/basic_ostream/op_destructor.md) diff --git a/reference/istream/basic_iostream/swap.md b/reference/istream/basic_iostream/swap.md new file mode 100644 index 0000000000..6aed84a160 --- /dev/null +++ b/reference/istream/basic_iostream/swap.md @@ -0,0 +1,43 @@ +# swap +* istream[meta header] +* std[meta namespace] +* basic_iostream[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +protected: + void swap(basic_iostream& rhs); // (1) C++11 +``` +* basic_iostream[link ../basic_iostream.md] + + +## 概要 +ストリームオブジェクトを交換する。 + + +## 効果 +[`basic_istream`](../basic_istream.md)`::`[`swap`](../basic_istream/swap.md)`(rhs)`を呼び出す。 + + +## 戻り値 +なし + + +## 備考 +[`rdbuf`](../../ios/basic_ios/rdbuf.md)`()`は交換されない。 + + +## バージョン +### 言語 +- C++11 + + +## 関連項目 +- [`basic_iostream`](../basic_iostream.md)`::`[`operator=`](op_assign.md) +- [`basic_istream`](../basic_istream.md)`::`[`swap`](../basic_istream/swap.md) + + +## 参照 +- [LWG Issue 911. I/O streams and move/swap semantic](https://cplusplus.github.io/LWG/issue911) + - C++11で、ムーブコンストラクタ・ムーブ代入演算子・`swap`が`protected`となり、非メンバ関数の`swap`が削除された。派生クラスのみが使用でき、基底クラスのオブジェクトを直接ムーブ・交換できないようにするため diff --git a/reference/istream/basic_istream.md b/reference/istream/basic_istream.md index 094c4a3f98..7510e8f74e 100644 --- a/reference/istream/basic_istream.md +++ b/reference/istream/basic_istream.md @@ -84,12 +84,13 @@ namespace std { | 名前 | 説明 | 対応バージョン | |---------------------------------------------------|----------------|----------------| | [`(constructor)`](basic_istream/op_constructor.md) | コンストラクタ | | -| `(destructor)` | デストラクタ | | -| `operator=` | ムーブ代入 | C++11 | -| `swap` | 値の交換 | C++11 | +| [`(destructor)`](basic_istream/op_destructor.md) | デストラクタ | | +| [`operator=`](basic_istream/op_assign.md) | ムーブ代入 | C++11 | +| [`swap`](basic_istream/swap.md) | 値の交換 | C++11 | -- コピーコンストラクタとコピー代入演算子はdelete定義されている。 -- ムーブコンストラクタ・ムーブ代入演算子と`swap`はprotectedで定義されている。 +- コピーコンストラクタとコピー代入演算子は、アクセス指定子`protected`で`delete`定義されている。 + - C++98では、これらは宣言されていなかった。コピーしようとすると、基底クラスである[`basic_ios`](../ios/basic_ios.md)のコピーコンストラクタ・コピー代入演算子がアクセス指定子`private`で宣言されているため、エラーとなっていた。 +- ムーブコンストラクタ・ムーブ代入演算子と`swap`は、アクセス指定子`protected`で定義されている。 ### 入力処理 @@ -148,3 +149,5 @@ syncは非書式化入力関数である。 - [`wcin`](../iostream/wcin.md) - [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) - C++23からローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された +- [LWG Issue 911. I/O streams and move/swap semantic](https://cplusplus.github.io/LWG/issue911) + - C++11で、ムーブコンストラクタ・ムーブ代入演算子・`swap`が`protected`となり、非メンバ関数の`swap`が削除された。派生クラスのみが使用でき、基底クラスのオブジェクトを直接ムーブ・交換できないようにするため diff --git a/reference/istream/basic_istream/op_assign.md b/reference/istream/basic_istream/op_assign.md new file mode 100644 index 0000000000..b982739dec --- /dev/null +++ b/reference/istream/basic_istream/op_assign.md @@ -0,0 +1,51 @@ +# operator= +* istream[meta header] +* std[meta namespace] +* basic_istream[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +protected: + basic_istream& operator=(const basic_istream& rhs) = delete; // (1) C++11 + + basic_istream& operator=(basic_istream&& rhs); // (2) C++11 +``` +* basic_istream[link ../basic_istream.md] + + +## 概要 +ストリームオブジェクトを代入する。 + + +## 効果 +- (1) : コピー代入演算子。コピー代入不可。 +- (2) : ムーブ代入演算子。[`swap`](swap.md)`(rhs)`を呼び出す。 + + +## 戻り値 +- (2) : `*this` + + +## 備考 +- (1) : + - C++98 : この演算子は宣言されていなかった。コピー代入を行おうとするとコンパイラがコピー代入演算子を暗黙に生成しようとするが、基底クラスの[`basic_ios`](../../ios/basic_ios.md)`::`[`operator=`](../../ios/basic_ios/op_assign.md)がアクセス指定子`private`で宣言されているため、エラーとなっていた + - C++11 : アクセス指定子`protected`で`delete`定義される。誤ってコピーしようとした際のエラーメッセージが分かりやすくなる +- (2) : [`rdbuf`](../../ios/basic_ios/rdbuf.md)`()`は交換されない。 + + +## バージョン +### 言語 +- C++11 + + +## 関連項目 +- [`basic_istream`](../basic_istream.md)`::`[`basic_istream`](op_constructor.md) +- [`basic_istream`](../basic_istream.md)`::`[`swap`](swap.md) +- [`basic_ios`](../../ios/basic_ios.md)`::`[`operator=`](../../ios/basic_ios/op_assign.md) +- [`basic_ios`](../../ios/basic_ios.md)`::`[`swap`](../../ios/basic_ios/swap.md) + + +## 参照 +- [LWG Issue 911. I/O streams and move/swap semantic](https://cplusplus.github.io/LWG/issue911) + - C++11で、ムーブコンストラクタ・ムーブ代入演算子・`swap`が`protected`となり、非メンバ関数の`swap`が削除された。派生クラスのみが使用でき、基底クラスのオブジェクトを直接ムーブ・交換できないようにするため diff --git a/reference/istream/basic_istream/op_constructor.md b/reference/istream/basic_istream/op_constructor.md index 1220b80565..5e2536d78b 100644 --- a/reference/istream/basic_istream/op_constructor.md +++ b/reference/istream/basic_istream/op_constructor.md @@ -5,19 +5,50 @@ * function[meta id-type] ```cpp -explicit basic_istream(basic_streambuf* sb); -basic_istream(basic_istream&& rhs); +public: + explicit basic_istream(basic_streambuf* sb); // (1) C++98 + +protected: + basic_istream(const basic_istream& rhs) = delete; // (2) C++11 + + basic_istream(basic_istream&& rhs); // (3) C++11 ``` +* basic_istream[link ../basic_istream.md] +* basic_streambuf[link ../../streambuf/basic_streambuf.md] + ## 概要 -オブジェクトを構築する。 +入力ストリームオブジェクトを構築する。 + +- (1) : ストリームバッファを受け取って構築する +- (2) : コピーコンストラクタ。コピー構築不可 +- (3) : ムーブコンストラクタ + -1つ目のコンストラクタは、`basic_ios::init(sb)`を呼び出す。 +## 効果 +- (1) : [`basic_ios`](../../ios/basic_ios.md)`::`[`init`](../../ios/basic_ios/init.md)`(sb)`を呼び出して初期化する。あわせて、[`gcount()`](gcount.md)が`0`を返すようにする。 +- (3) : 基底クラスを[`basic_ios`](../../ios/basic_ios.md)`::`[`move`](../../ios/basic_ios/move.md)`(rhs)`によってムーブ構築し、`rhs`の[`gcount()`](gcount.md)の値をコピーする。その後、`rhs`の[`gcount()`](gcount.md)を`0`にする。 + + +## 備考 +- (2) : + - C++98 : このコンストラクタは宣言されていなかった。コピー構築を行おうとするとコンパイラがコピーコンストラクタを暗黙に生成しようとするが、基底クラスの[`basic_ios`](../../ios/basic_ios.md)のコピーコンストラクタがアクセス指定子`private`で宣言されているため、エラーとなっていた + - C++11 : アクセス指定子`protected`で`delete`定義される。誤ってコピーしようとした際のエラーメッセージが分かりやすくなる -## 実装例 ## バージョン ### 言語 - C++98 + +## 関連項目 +- [`basic_istream`](../basic_istream.md)`::`[`~basic_istream`](op_destructor.md) +- [`basic_istream`](../basic_istream.md)`::`[`operator=`](op_assign.md) +- [`basic_istream`](../basic_istream.md)`::`[`swap`](swap.md) +- [`basic_ios`](../../ios/basic_ios.md)`::`[`init`](../../ios/basic_ios/init.md) +- [`basic_ios`](../../ios/basic_ios.md)`::`[`move`](../../ios/basic_ios/move.md) + + ## 参照 +- [LWG Issue 911. I/O streams and move/swap semantic](https://cplusplus.github.io/LWG/issue911) + - C++11で、ムーブコンストラクタ・ムーブ代入演算子・`swap`が`protected`となり、非メンバ関数の`swap`が削除された。派生クラスのみが使用でき、基底クラスのオブジェクトを直接ムーブ・交換できないようにするため diff --git a/reference/istream/basic_istream/op_destructor.md b/reference/istream/basic_istream/op_destructor.md new file mode 100644 index 0000000000..fc2c30cc26 --- /dev/null +++ b/reference/istream/basic_istream/op_destructor.md @@ -0,0 +1,28 @@ +# デストラクタ +* istream[meta header] +* std[meta namespace] +* basic_istream[meta class] +* function[meta id-type] + +```cpp +virtual ~basic_istream(); // (1) C++98 +``` +* basic_istream[link ../basic_istream.md] + + +## 概要 +入力ストリームオブジェクトを破棄する。 + + +## 備考 +[`rdbuf`](../../ios/basic_ios/rdbuf.md)`()`に対する操作は、一切行わない。 + + +## バージョン +### 言語 +- C++98 + + +## 関連項目 +- [`basic_istream`](../basic_istream.md)`::`[`basic_istream`](op_constructor.md) +- [`basic_ios`](../../ios/basic_ios.md)`::`[`~basic_ios`](../../ios/basic_ios/op_destructor.md) diff --git a/reference/istream/basic_istream/op_istream.md b/reference/istream/basic_istream/op_istream.md index f68fe45c95..a974786327 100644 --- a/reference/istream/basic_istream/op_istream.md +++ b/reference/istream/basic_istream/op_istream.md @@ -56,6 +56,8 @@ basic_istream& 1. `sentry`オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない 1. `num_get::get`を使用して入力のパース・数値への変換を行う。 - `int`と`short` : `long`を実引数に取るものを使用する。結果が`int`と`short`それぞれの範囲外の値になった場合、ローカルエラー状態に`failbit`を設定する + - C++98 : 値は格納されない + - C++11 : 範囲を下回っていれば[`numeric_limits`](/reference/limits/numeric_limits.md)`::min()`、上回っていれば[`numeric_limits`](/reference/limits/numeric_limits.md)`::max()`を代入する - 拡張浮動小数点数型 : - 拡張浮動小数点数型の変換順位が`long double`より大きい場合、条件付きサポートとなる - そうでない場合、対応する標準浮動小数点数型`FP`を以下のように定義し、`FP`型の値として値を入力したあと、拡張浮動小数点数型にキャストして代入する @@ -129,3 +131,5 @@ TBD - 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`入力がサポートされた +- [LWG Issue 696. `istream::operator>>`(int&) broken](https://cplusplus.github.io/LWG/issue696) + - C++11で、`int`と`short`の抽出において範囲外の値になった場合に`numeric_limits::min()`/`max()`を代入することが明記された。以前は値を代入せずに`failbit`を設定するだけだったため、[`num_get`](/reference/locale/num_get.md)側の「抽出に失敗した場合は`0`を代入する」という規定と矛盾していた diff --git a/reference/istream/basic_istream/sentry/op_constructor.md b/reference/istream/basic_istream/sentry/op_constructor.md index a7957f72d5..d04b204ace 100644 --- a/reference/istream/basic_istream/sentry/op_constructor.md +++ b/reference/istream/basic_istream/sentry/op_constructor.md @@ -23,3 +23,8 @@ explicit sentry(basic_istream& is, bool noskipws = false); - このとき`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`を返すようになる。 + + +## 参照 +- [LWG Issue 419. `istream` extractors not setting `failbit` if `eofbit` is already set](https://cplusplus.github.io/LWG/issue419) + - C++11で、`is.good()`が`false`の場合に`setstate(failbit)`を呼び出すことが規定された。それ以前は「`good()`が`true`なら入力の準備をする」としか書かれておらず、既に`eofbit`が立っているストリームから抽出しても`failbit`が立たないため、抽出の失敗を検知できなかった diff --git a/reference/istream/basic_istream/swap.md b/reference/istream/basic_istream/swap.md new file mode 100644 index 0000000000..436f4452c3 --- /dev/null +++ b/reference/istream/basic_istream/swap.md @@ -0,0 +1,43 @@ +# swap +* istream[meta header] +* std[meta namespace] +* basic_istream[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +protected: + void swap(basic_istream& rhs); // (1) C++11 +``` +* basic_istream[link ../basic_istream.md] + + +## 概要 +ストリームオブジェクトを交換する。 + + +## 効果 +[`basic_ios`](../../ios/basic_ios.md)`::`[`swap`](../../ios/basic_ios/swap.md)`(rhs)`を呼び出し、`*this`と`rhs`の[`gcount()`](gcount.md)の値を交換する。 + + +## 戻り値 +なし + + +## 備考 +[`rdbuf`](../../ios/basic_ios/rdbuf.md)`()`は交換されない。 + + +## バージョン +### 言語 +- C++11 + + +## 関連項目 +- [`basic_istream`](../basic_istream.md)`::`[`operator=`](op_assign.md) +- [`basic_ios`](../../ios/basic_ios.md)`::`[`swap`](../../ios/basic_ios/swap.md) + + +## 参照 +- [LWG Issue 911. I/O streams and move/swap semantic](https://cplusplus.github.io/LWG/issue911) + - C++11で、ムーブコンストラクタ・ムーブ代入演算子・`swap`が`protected`となり、非メンバ関数の`swap`が削除された。派生クラスのみが使用でき、基底クラスのオブジェクトを直接ムーブ・交換できないようにするため diff --git a/reference/ostream/basic_ostream.md b/reference/ostream/basic_ostream.md index 70a910c565..1a08f4c1df 100644 --- a/reference/ostream/basic_ostream.md +++ b/reference/ostream/basic_ostream.md @@ -63,9 +63,12 @@ namespace std { |----------------------------------------------------|----------------|----------------| | [`(constructor)`](basic_ostream/op_constructor.md) | コンストラクタ | | | [`(destructor)`](basic_ostream/op_destructor.md) | デストラクタ | | +| [`operator=`](basic_ostream/op_assign.md) | ムーブ代入 | C++11 | +| [`swap`](basic_ostream/swap.md) | 値の交換 | C++11 | -- コピーコンストラクタとコピー代入演算子はdelete定義されている。 -- ムーブコンストラクタ・ムーブ代入演算子と`swap`はprotectedで定義されている。 +- コピーコンストラクタとコピー代入演算子は、アクセス指定子`protected`で`delete`定義されている。 + - C++98では、これらは宣言されていなかった。コピーしようとすると、基底クラスである[`basic_ios`](../ios/basic_ios.md)のコピーコンストラクタ・コピー代入演算子がアクセス指定子`private`で宣言されているため、エラーとなっていた。 +- ムーブコンストラクタ・ムーブ代入演算子と`swap`は、アクセス指定子`protected`で定義されている。 ### 出力処理 @@ -111,3 +114,5 @@ namespace std { - [`wclog`](../iostream/wclog.md.nolink) - [`cerr`](../iostream/cerr.md) - [`wcerr`](../iostream/wcerr.md.nolink) +- [LWG Issue 911. I/O streams and move/swap semantic](https://cplusplus.github.io/LWG/issue911) + - C++11で、ムーブコンストラクタ・ムーブ代入演算子・`swap`が`protected`となり、非メンバ関数の`swap`が削除された。派生クラスのみが使用でき、基底クラスのオブジェクトを直接ムーブ・交換できないようにするため diff --git a/reference/ostream/basic_ostream/op_assign.md b/reference/ostream/basic_ostream/op_assign.md index e58615232a..64cc5ef86d 100644 --- a/reference/ostream/basic_ostream/op_assign.md +++ b/reference/ostream/basic_ostream/op_assign.md @@ -7,9 +7,9 @@ ```cpp protected: - basic_ostream& operator=(const basic_ostream& rhs) = delete; // (1) + basic_ostream& operator=(const basic_ostream& rhs) = delete; // (1) C++11 - basic_ostream& operator=(basic_ostream&& rhs); // (2) + basic_ostream& operator=(basic_ostream&& rhs); // (2) C++11 ``` * basic_ostream[link ../basic_ostream.md] @@ -47,7 +47,7 @@ protected: - [Visual C++](/implementation.md#visual_cpp): ?? -## 参照 +## 関連項目 - [`basic_ostream`](../basic_ostream.md)`::`[`basic_ostream`](op_constructor.md) - [`basic_ios`](../../ios/basic_ios.md)`::`[`basic_ios`](../../ios/basic_ios/op_constructor.md) - [`basic_ios`](../../ios/basic_ios.md)`::`[`operator=`](../../ios/basic_ios/op_assign.md) diff --git a/reference/ostream/basic_ostream/op_constructor.md b/reference/ostream/basic_ostream/op_constructor.md index ed1d03d1ce..f386d8f420 100644 --- a/reference/ostream/basic_ostream/op_constructor.md +++ b/reference/ostream/basic_ostream/op_constructor.md @@ -6,12 +6,12 @@ ```cpp public: - explicit basic_ostream(basic_streambuf* sb); // (1) + explicit basic_ostream(basic_streambuf* sb); // (1) C++98 protected: - basic_ostream(const basic_ostream& rhs) = delete; // (2) C++11 から + basic_ostream(const basic_ostream& rhs) = delete; // (2) C++11 - basic_ostream(basic_ostream&& rhs); // (3) C++11 から + basic_ostream(basic_ostream&& rhs); // (3) C++11 ``` * basic_ostream[link ../basic_ostream.md] * basic_streambuf[link ../../streambuf/basic_streambuf.md] @@ -46,7 +46,7 @@ protected: - [Visual C++](/implementation.md#visual_cpp): ?? -## 参照 +## 関連項目 - [`basic_ostream`](../basic_ostream.md)`::`[`~basic_ostream`](op_destructor.md) - [`basic_ostream`](../basic_ostream.md)`::`[`operator=`](op_assign.md) - [`basic_ostream`](../basic_ostream.md)`::`[`swap`](swap.md) diff --git a/reference/ostream/basic_ostream/op_destructor.md b/reference/ostream/basic_ostream/op_destructor.md index 6df9a183a0..ba530b29bc 100644 --- a/reference/ostream/basic_ostream/op_destructor.md +++ b/reference/ostream/basic_ostream/op_destructor.md @@ -5,7 +5,7 @@ * function[meta id-type] ```cpp -virtual ~basic_ostream(); +virtual ~basic_ostream(); // (1) C++98 ``` * basic_ostream[link ../basic_ostream.md] @@ -20,7 +20,7 @@ virtual ~basic_ostream(); ## バージョン ### 言語 -- C++11 +- C++98 ### 処理系 @@ -30,7 +30,7 @@ virtual ~basic_ostream(); - [Visual C++](/implementation.md#visual_cpp): ?? -## 参照 +## 関連項目 - [`basic_ostream`](../basic_ostream.md)`::`[`basic_ostream`](op_constructor.md) - [`basic_ostream`](../basic_ostream.md)`::`[`swap`](swap.md) - [`basic_ostream`](../basic_ostream.md)`::`[`operator=`](op_assign.md) diff --git a/reference/ostream/basic_ostream/swap.md b/reference/ostream/basic_ostream/swap.md index 76bd18e56b..720864fb0b 100644 --- a/reference/ostream/basic_ostream/swap.md +++ b/reference/ostream/basic_ostream/swap.md @@ -7,7 +7,7 @@ ```cpp protected: - void swap(basic_ostream& rhs); + void swap(basic_ostream& rhs); // (1) C++11 ``` * basic_ostream[link ../basic_ostream.md] @@ -33,6 +33,6 @@ protected: - C++11 -## 参照 +## 関連項目 - [`basic_ios`](../../ios/basic_ios.md)`::`[`move`](../../ios/basic_ios/move.md) - [`basic_ios`](../../ios/basic_ios.md)`::`[`swap`](../../ios/basic_ios/swap.md) From da3c72377bc7eae4dbd6c6cdaf086415ed0fd97e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:36:04 +0900 Subject: [PATCH 042/147] =?UTF-8?q?(back=5F=20|=20front=5F)insert=5Fiterat?= =?UTF-8?q?or=E3=81=AE=E4=BB=A3=E5=85=A5=E6=BC=94=E7=AE=97=E5=AD=90=20:=20?= =?UTF-8?q?=E3=83=91=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF=E5=9E=8B=E3=81=8C?= =?UTF-8?q?C++98=E3=81=AEconst=5Freference=E3=81=8B=E3=82=89C++11=20const?= =?UTF-8?q?=E5=8F=82=E7=85=A7=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=AB=E3=81=AA?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E3=81=AE=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/iterator/back_insert_iterator/op_assign.md | 10 +++++++--- reference/iterator/front_insert_iterator/op_assign.md | 10 +++++++--- reference/iterator/insert_iterator/op_assign.md | 6 +++++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/reference/iterator/back_insert_iterator/op_assign.md b/reference/iterator/back_insert_iterator/op_assign.md index 9b38b3c5e5..f35c7350f1 100644 --- a/reference/iterator/back_insert_iterator/op_assign.md +++ b/reference/iterator/back_insert_iterator/op_assign.md @@ -6,7 +6,9 @@ ```cpp back_insert_iterator& - operator=(const typename Container::value_type& value); // (1) C++98 + operator=(typename Container::const_reference value); // (1) C++98 +back_insert_iterator& + operator=(const typename Container::value_type& value); // (1) C++11 constexpr back_insert_iterator& operator=(const typename Container::value_type& value); // (1) C++20 @@ -21,8 +23,8 @@ constexpr back_insert_iterator& ## 効果 -- `const`参照版: `container->push_back(value);` -- 右辺値参照版: `container->push_back(`[`std::move`](/reference/utility/move.md)`(value));` +- (1) : `container->push_back(value);` +- (2) : `container->push_back(`[`std::move`](/reference/utility/move.md)`(value));` ## 戻り値 @@ -31,3 +33,5 @@ constexpr back_insert_iterator& ## 参照 - [P1032R1 Misc `constexpr` bits](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1032r1.html) +- [LWG Issue 1334. Insert iterators are broken for some proxy containers compared to C++03](https://cplusplus.github.io/LWG/issue1334) + - C++11で、代入演算子の引数型が`Container::const_reference`から`const Container::value_type&`へ改められた。[`vector`](/reference/vector/vector.md)のようにプロキシ参照を持つコンテナでは、`const_reference`が参照型ではないため代入できなかった diff --git a/reference/iterator/front_insert_iterator/op_assign.md b/reference/iterator/front_insert_iterator/op_assign.md index a85d529df8..2ace2def76 100644 --- a/reference/iterator/front_insert_iterator/op_assign.md +++ b/reference/iterator/front_insert_iterator/op_assign.md @@ -6,7 +6,9 @@ ```cpp front_insert_iterator& - operator=(const typename Container::value_type& value); // (1) C++98 + operator=(typename Container::const_reference value); // (1) C++98 +front_insert_iterator& + operator=(const typename Container::value_type& value); // (1) C++11 constexpr front_insert_iterator& operator=(const typename Container::value_type& value); // (1) C++20 @@ -21,8 +23,8 @@ constexpr front_insert_iterator& ## 効果 -- `const`参照版:`container->push_front(value);` -- 右辺値参照版: `container->push_front(`[`std::move`](/reference/utility/move.md)`(value));` +- (1) : `container->push_front(value);` +- (2) : `container->push_front(`[`std::move`](/reference/utility/move.md)`(value));` ## 戻り値 @@ -31,3 +33,5 @@ constexpr front_insert_iterator& ## 参照 - [P1032R1 Misc `constexpr` bits](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1032r1.html) +- [LWG Issue 1334. Insert iterators are broken for some proxy containers compared to C++03](https://cplusplus.github.io/LWG/issue1334) + - C++11で、代入演算子の引数型が`Container::const_reference`から`const Container::value_type&`へ改められた。[`vector`](/reference/vector/vector.md)のようにプロキシ参照を持つコンテナでは、`const_reference`が参照型ではないため代入できなかった diff --git a/reference/iterator/insert_iterator/op_assign.md b/reference/iterator/insert_iterator/op_assign.md index 211e1530dd..f62f754794 100644 --- a/reference/iterator/insert_iterator/op_assign.md +++ b/reference/iterator/insert_iterator/op_assign.md @@ -6,7 +6,9 @@ ```cpp insert_iterator& - operator=(const typename Container::value_type& value); // (1) C++98 + operator=(typename Container::const_reference value); // (1) C++98 +insert_iterator& + operator=(const typename Container::value_type& value); // (1) C++11 constexpr insert_iterator& operator=(const typename Container::value_type& value); // (1) C++20 @@ -40,3 +42,5 @@ constexpr insert_iterator& ## 参照 - [P1032R1 Misc `constexpr` bits](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1032r1.html) +- [LWG Issue 1334. Insert iterators are broken for some proxy containers compared to C++03](https://cplusplus.github.io/LWG/issue1334) + - C++11で、代入演算子の引数型が`Container::const_reference`から`const Container::value_type&`へ改められた。[`vector`](/reference/vector/vector.md)のようにプロキシ参照を持つコンテナでは、`const_reference`が参照型ではないため代入できなかった From 21176975dcc152a7b6ef290b13706507e7963b80 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:41:53 +0900 Subject: [PATCH 043/147] =?UTF-8?q?istream=5Fiterator=20:=20=E4=BA=8B?= =?UTF-8?q?=E5=89=8D=E6=9D=A1=E4=BB=B6=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/iterator/istream_iterator/op_arrow.md | 4 ++++ reference/iterator/istream_iterator/op_deref.md | 4 ++++ reference/iterator/istream_iterator/op_increment.md | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/reference/iterator/istream_iterator/op_arrow.md b/reference/iterator/istream_iterator/op_arrow.md index e3a1dd7290..cc16152f1a 100644 --- a/reference/iterator/istream_iterator/op_arrow.md +++ b/reference/iterator/istream_iterator/op_arrow.md @@ -12,6 +12,10 @@ const T* operator->() const; イテレータを通してオブジェクトにアクセスする +## 事前条件 +`*this`が終端イテレータではないこと(保持している入力ストリームへのポインタがヌルポインタではないこと)。この条件を満たさない場合、動作は未定義である。 + + ## 戻り値 `&(operator*())` diff --git a/reference/iterator/istream_iterator/op_deref.md b/reference/iterator/istream_iterator/op_deref.md index d10523b6c7..b06cd39308 100644 --- a/reference/iterator/istream_iterator/op_deref.md +++ b/reference/iterator/istream_iterator/op_deref.md @@ -13,6 +13,10 @@ const T& operator*() const; 読み込み済みの値を返す。 +## 事前条件 +`*this`が終端イテレータではないこと(保持している入力ストリームへのポインタがヌルポインタではないこと)。この条件を満たさない場合、動作は未定義である。 + + ## 戻り値 `operator++()`で入力ストリームから読み込まれ、メンバ変数として保持されている値を返す。 diff --git a/reference/iterator/istream_iterator/op_increment.md b/reference/iterator/istream_iterator/op_increment.md index 126905eeab..b482813bbb 100644 --- a/reference/iterator/istream_iterator/op_increment.md +++ b/reference/iterator/istream_iterator/op_increment.md @@ -14,6 +14,10 @@ istream_iterator operator++(int); 入力ストリームから`operator>>`でデータを読み取る。 +## 事前条件 +`*this`が終端イテレータではないこと(保持している入力ストリームへのポインタがヌルポインタではないこと)。この条件を満たさない場合、動作は未定義である。 + + ## 効果 前置`operator++`: `*in_stream >> value;` @@ -26,6 +30,7 @@ istream_iterator operator++(int); ※`in_stream`は、メンバ変数として保持している入力ストリームオブジェクトへのポインタ + ## 例 ```cpp example #include @@ -59,3 +64,5 @@ int main() ``` ## 参照 +- [LWG Issue 838. Can an end-of-stream iterator become a non-end-of-stream one?](https://cplusplus.github.io/LWG/issue838) + - C++11で、終端イテレータに対してこの演算子を呼び出したときの動作は未定義であることが明記された。終端イテレータが再び非終端イテレータに戻ることはない From 5bc138067cb52e71f0452b5c1eba3c3641dfa44f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:42:40 +0900 Subject: [PATCH 044/147] =?UTF-8?q?istream=5Fiterator=20:=20=E8=AA=AD?= =?UTF-8?q?=E3=81=BF=E5=8F=96=E3=82=8A=E5=A4=B1=E6=95=97=E6=99=82=E3=81=AB?= =?UTF-8?q?=E7=B5=82=E7=AB=AF=E3=82=A4=E3=83=86=E3=83=AC=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=81=AB=E3=81=AA=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C=E8=A6=8F?= =?UTF-8?q?=E5=AE=9A=E3=81=95=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/istream_iterator.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/iterator/istream_iterator.md b/reference/iterator/istream_iterator.md index 2b1765915e..0cb0a04df2 100644 --- a/reference/iterator/istream_iterator.md +++ b/reference/iterator/istream_iterator.md @@ -64,6 +64,8 @@ namespace std { ## 備考 このクラスは、フリースタンディング処理系では使用できない。 +構築時および`++`のたびに、ストリームから型`T`の値を読み取って保持する。値の読み取りに失敗した場合 (ストリームの[`fail()`](/reference/ios/basic_ios/fail.md)が`true`を返す場合)、そのイテレータは終端イテレータと等値になる。 + ## 例 ```cpp example #include @@ -103,6 +105,8 @@ int main() - [`basic_istream_view`](/reference/ranges/basic_istream_view.md): ストリームからデータを読み込むRange ## 参照 +- [LWG Issue 788. Ambiguity in `[istream.iterator]`](https://cplusplus.github.io/LWG/issue788) + - C++11で、終端イテレータと等値になる条件が「ストリームの終端に達した場合」から「型`T`の値の読み取りに失敗した場合 ([`fail()`](/reference/ios/basic_ios/fail.md)が`true`を返す場合)」へ改められた。書式エラーで抽出に失敗した場合の扱いが曖昧だったため - [LWG Issue 2878. Missing `DefaultConstructible` requirement for `istream_iterator` default constructor](https://cplusplus.github.io/LWG/issue2878) - 型`T`が`DefaultConstructible`・`CopyConstructible`・`CopyAssignable`の要件を満たす必要があることが明記された - この修正は欠陥報告(DR)であり、C++98に遡及して適用される。メンバとして`T`のオブジェクトを保持する以上これらは実装上当初から必須だった要件であり、規定から抜け落ちていたものの明文化であるため From 9b72ec50bc06486db2ffd6b8f29d7bd327a4ccf0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:50:44 +0900 Subject: [PATCH 045/147] =?UTF-8?q?thread=E3=83=98=E3=83=83=E3=83=80=20:?= =?UTF-8?q?=20=E3=83=95=E3=83=AA=E3=83=BC=E3=82=B9=E3=82=BF=E3=83=B3?= =?UTF-8?q?=E3=83=87=E3=82=A3=E3=83=B3=E3=82=B0=E7=92=B0=E5=A2=83=E3=81=A7?= =?UTF-8?q?=E3=81=AE=E6=89=B1=E3=81=84=E3=81=8C=E8=A6=8F=E5=AE=9A=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/thread.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/thread.md b/reference/thread.md index ab3a9b54e7..1d9760e3e3 100644 --- a/reference/thread.md +++ b/reference/thread.md @@ -17,6 +17,11 @@ | [`jthread`](thread/jthread.md) | 停止要求を扱ったり、自動で[`join`](thread/jthread/join.md)する機能を持つスレッド クラス (class) | C++20 | +## 備考 +- このヘッダは、フリースタンディング処理系ではホスト処理系と同じ内容を提供するか、あるいはインクルードしても何の効果も持たないかのいずれかである。 +- プログラムが複数のスレッドを実行できる場合、[`__STDCPP_THREADS__`](/lang/cpp11/predefined_macros.md)マクロが整数値`1`として定義される。 + + ## バージョン ### 言語 - C++11 @@ -30,3 +35,5 @@ - [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) +- [LWG Issue 1097. #define `__STDCPP_THREADS`](https://cplusplus.github.io/LWG/issue1097) + - C++11で、フリースタンディング処理系におけるこのヘッダの扱いが規定され、複数スレッドを実行できる場合に定義されるマクロが追加された。このマクロは最終的に、このヘッダではなく予定義マクロ[`__STDCPP_THREADS__`](/lang/cpp11/predefined_macros.md)として規定された From 2a07ff3ea6c2b40cf10d85d5aaffb283bc373905 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:51:39 +0900 Subject: [PATCH 046/147] =?UTF-8?q?valarray=20:=20C++98=20/=20C++11?= =?UTF-8?q?=E4=BB=95=E6=A7=98=E3=82=92=E6=9B=B8=E3=81=8D=E5=88=86=E3=81=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/valarray/valarray/op_assign.md | 6 +++++- reference/valarray/valarray/op_at.md | 4 ++++ reference/valarray/valarray/op_constructor.md | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/reference/valarray/valarray/op_assign.md b/reference/valarray/valarray/op_assign.md index d728bba296..c67afc069b 100644 --- a/reference/valarray/valarray/op_assign.md +++ b/reference/valarray/valarray/op_assign.md @@ -34,7 +34,9 @@ valarray& operator=(const indirect_array& x); // (8) ## 効果 -- (1) : `*this`と`x`が異なる要素数の場合、`resize(x.size())`を呼び出す。`*this`の各要素に、`x`の各要素を代入する。 +- (1) : + - C++98 : `*this`の各要素に、`x`の各要素を代入する。要素数が異なる場合、動作は未定義 + - C++11 : `*this`と`x`が異なる要素数の場合、`resize(x.size())`を呼び出す。`*this`の各要素に、`x`の各要素を代入する - (2) : `*this`に`x`の所有権を譲渡する。ムーブ後の`x`の状態は未規定。 - (3) : `*this = valarray(init)`と等価。 - (4) : `*this`の全ての要素に値`value`を代入する。 @@ -147,5 +149,7 @@ va8 : {1,3,5} ## 参照 - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - (3)の経緯となる提案文書 +- [LWG Issue 630. arrays of `valarray`](https://cplusplus.github.io/LWG/issue630) + - C++11で、コピー代入において要素数が異なる場合に`resize()`で長さを合わせることが規定された。それ以前は動作は未定義とされており、`valarray`の配列を宣言するとデフォルト構築(要素数0)された要素へ代入できず、事実上使えなかった - [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 361703ac97..72f56711f0 100644 --- a/reference/valarray/valarray/op_at.md +++ b/reference/valarray/valarray/op_at.md @@ -62,6 +62,8 @@ indirect_array operator[](const ValOrProxy& mask); // (10) [``](../../valarray.md) の概要も参照のこと。 - (3), (5), (7), (9) : `valarray`型のオブジェクトを返すこの関数を含むあらゆる関数は、`valarray`クラスと同じ`const`メンバ関数をもつほかの型を返すことが実装に許可される。例として複数の`valarray`操作をつなげて記述したときに最適化できるよう、式テンプレートを返す実装もある - (7), (8) : [`size()`](size.md) `!= mask.`[`size()`](size.md)の場合、未定義動作を引き起こす。 +- (9), (10) : `mask`に含まれるインデックス値のいずれかが[`size()`](size.md)以上である場合、未定義動作を引き起こす。また、`mask`に同じインデックス値が複数含まれる場合、非`const`版(10)の動作は未定義である。 +- (4), (6), (8), (10) : 返される`slice_array`・`gslice_array`・`mask_array`・`indirect_array`は、元の`valarray`の要素への参照を保持する。元の`valarray`が破棄されたあと、あるいは要素数が変化したあとにこれらのオブジェクトを使用した場合、動作は未定義である。 ## 例 @@ -276,3 +278,5 @@ 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++98の`T`から、C++11の`const T&`に変更された経緯のレポート +- [LWG Issue 430. `valarray` subset operations](https://cplusplus.github.io/LWG/issue430) + - C++11で、部分集合を取り出す各オーバーロードの規定が整理され、インデックス値が範囲外である場合や、`indirect_array`で同じインデックスが重複する場合の動作は未定義であることが明記された diff --git a/reference/valarray/valarray/op_constructor.md b/reference/valarray/valarray/op_constructor.md index 125b642a60..4953078045 100644 --- a/reference/valarray/valarray/op_constructor.md +++ b/reference/valarray/valarray/op_constructor.md @@ -173,3 +173,5 @@ 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)の経緯となる提案文書 +- [LWG Issue 1208. `valarray` `initializer_list` constructor has incorrect effects](https://cplusplus.github.io/LWG/issue1208) + - C++11で、初期化子リストからのコンストラクタの効果が`valarray(il.begin(), il.end())`から`valarray(il.begin(), il.size())`へ修正された。ポインタと要素数を受け取るコンストラクタに対して、終端イテレータを要素数として渡していたため From 5fb3de4c411bb7327bb5004cc72b020a35dffc1e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:52:34 +0900 Subject: [PATCH 047/147] =?UTF-8?q?pair=E3=81=AE=E4=BB=A3=E5=85=A5?= =?UTF-8?q?=E6=BC=94=E7=AE=97=E5=AD=90=20:=20=E5=9E=8B=E5=A4=89=E6=8F=9B?= =?UTF-8?q?=E3=82=92=E3=81=99=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=81=AFC++98=E3=81=A7=E3=81=AF?= =?UTF-8?q?=E3=81=AA=E3=81=8FC++11=E3=81=8B=E3=82=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/utility/pair/op_assign.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/utility/pair/op_assign.md b/reference/utility/pair/op_assign.md index 8e8da1dec8..8e0886be5c 100644 --- a/reference/utility/pair/op_assign.md +++ b/reference/utility/pair/op_assign.md @@ -11,7 +11,7 @@ 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); // (3) C++98 + pair& operator=(const pair& p); // (3) C++11 template constexpr pair& operator=(const pair& p); // (3) C++20 @@ -163,9 +163,11 @@ p4 : (1,abc) - (1), (3)はそれより前から実装されている。 ## 参照 +- [LWG Issue 885. `pair` assignment](https://cplusplus.github.io/LWG/issue885) + - C++11で、変換可能な[`pair`](../pair.md)からのコピー代入(3)が追加された。変換可能な[`pair`](../pair.md)からの構築はC++98からできたが、代入はできなかった +- [P1032R1 Misc constexpr bits](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1032r1.html) - [LWG Issue 2729. Missing SFINAE on `std::pair::operator=`](https://cplusplus.github.io/LWG/issue2729) - C++17で、コピー代入演算子(1)が要素型のコピー代入可能性を満たさない場合は`delete`定義されるよう規定され、`is_copy_assignable`等が正しい結果を返すようになった -- [P1032R1 Misc constexpr bits](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1032r1.html) - [LWG Issue 2958. Moves improperly defined as deleted](https://cplusplus.github.io/LWG/issue2958) - C++20で、ムーブ代入演算子が要素型の代入不可時に`delete`定義ではなくオーバーロード解決に参加しない形へ修正され、コピー代入へのフォールバックが可能になった - この修正は欠陥報告(DR)であり、C++17に遡及して適用される。C++17の「`delete`定義される」という文言では、暗黙`delete`(オーバーロード解決に不参加)か明示`delete`(コピー代入を隠す)かが不明確で意図どおりに実装できなかったため From 9a9fbd388667b06d5ff1b2f7de3010b43ea6871a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:53:10 +0900 Subject: [PATCH 048/147] =?UTF-8?q?pair=20:=20LWG=20Issue=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/utility/pair/op_greater.md | 2 ++ reference/utility/pair/op_greater_equal.md | 2 ++ reference/utility/pair/op_less_equal.md | 2 ++ reference/utility/pair/op_not_equal.md | 2 ++ reference/utility/pair/swap.md | 2 ++ 5 files changed, 10 insertions(+) diff --git a/reference/utility/pair/op_greater.md b/reference/utility/pair/op_greater.md index 6b784a36a3..c09fba2910 100644 --- a/reference/utility/pair/op_greater.md +++ b/reference/utility/pair/op_greater.md @@ -50,3 +50,5 @@ true - [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での三方比較演算子の追加と、関連する演算子の自動導出 +- [LWG Issue 296. Missing descriptions and requirements of `pair` operators](https://cplusplus.github.io/LWG/issue296) + - C++11で、`operator==`と`operator<`以外の比較演算子についても、戻り値が`y < x`であることが明記された。それ以前は``の概要に宣言があるだけで、動作の規定がなかった diff --git a/reference/utility/pair/op_greater_equal.md b/reference/utility/pair/op_greater_equal.md index 5e3d9c7d7d..d5f845a092 100644 --- a/reference/utility/pair/op_greater_equal.md +++ b/reference/utility/pair/op_greater_equal.md @@ -55,3 +55,5 @@ true - [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での三方比較演算子の追加と、関連する演算子の自動導出 +- [LWG Issue 296. Missing descriptions and requirements of `pair` operators](https://cplusplus.github.io/LWG/issue296) + - C++11で、`operator==`と`operator<`以外の比較演算子についても、戻り値が`!(x < y)`であることが明記された。それ以前は``の概要に宣言があるだけで、動作の規定がなかった diff --git a/reference/utility/pair/op_less_equal.md b/reference/utility/pair/op_less_equal.md index 200fae53fa..cd842bc9ed 100644 --- a/reference/utility/pair/op_less_equal.md +++ b/reference/utility/pair/op_less_equal.md @@ -55,3 +55,5 @@ true - [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での三方比較演算子の追加と、関連する演算子の自動導出 +- [LWG Issue 296. Missing descriptions and requirements of `pair` operators](https://cplusplus.github.io/LWG/issue296) + - C++11で、`operator==`と`operator<`以外の比較演算子についても、戻り値が`!(y < x)`であることが明記された。それ以前は``の概要に宣言があるだけで、動作の規定がなかった diff --git a/reference/utility/pair/op_not_equal.md b/reference/utility/pair/op_not_equal.md index b0e0319cb3..5be8d0104a 100644 --- a/reference/utility/pair/op_not_equal.md +++ b/reference/utility/pair/op_not_equal.md @@ -52,3 +52,5 @@ true - [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での三方比較演算子の追加と、関連する演算子の自動導出 +- [LWG Issue 296. Missing descriptions and requirements of `pair` operators](https://cplusplus.github.io/LWG/issue296) + - C++11で、`operator==`と`operator<`以外の比較演算子についても、戻り値が`!(x == y)`であることが明記された。それ以前は``の概要に宣言があるだけで、動作の規定がなかった diff --git a/reference/utility/pair/swap.md b/reference/utility/pair/swap.md index d1b79e565a..01bb89ae55 100644 --- a/reference/utility/pair/swap.md +++ b/reference/utility/pair/swap.md @@ -66,3 +66,5 @@ p2 : (1,aaa) ## 参照 - [P1032R1 Misc constexpr bits](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1032r1.html) +- [LWG Issue 1349. `swap` should not throw](https://cplusplus.github.io/LWG/issue1349) + - C++11の策定時に、ドラフト段階で無条件`noexcept`となっていたものが、条件付きの形 (`noexcept(see below)`) へ修正された From 14fa1a98e4e03cace575d6e8d2f306a760e6fc2c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:53:33 +0900 Subject: [PATCH 049/147] =?UTF-8?q?stack=20:=20LWG=20Issue=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/stack/stack/op_constructor.md | 4 ++++ reference/stack/stack/swap.md | 2 ++ 2 files changed, 6 insertions(+) diff --git a/reference/stack/stack/op_constructor.md b/reference/stack/stack/op_constructor.md index b002611209..2dbb31da6e 100644 --- a/reference/stack/stack/op_constructor.md +++ b/reference/stack/stack/op_constructor.md @@ -141,3 +141,7 @@ int main() - [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) +- [LWG Issue 1194. Unintended `queue` constructor](https://cplusplus.github.io/LWG/issue1194) + - C++11で、アロケータを受け取るコンストラクタ群が、[`uses_allocator`](/reference/memory/uses_allocator.md)`::value`が`true`である場合にのみオーバーロード解決に参加するよう制約された。制約がないと、`Alloc`にコンテナが構築可能な任意の型を渡せてしまい、`stack s(5);`のような意図しない構築が通ってしまうため +- [LWG Issue 1199. Missing extended copy constructor in container adaptors](https://cplusplus.github.io/LWG/issue1199) + - C++11で、アロケータを指定する拡張コピーコンストラクタが追加された。ムーブ版は既に用意されていたが、コピー版が漏れていた diff --git a/reference/stack/stack/swap.md b/reference/stack/stack/swap.md index e265e78f9f..e2d07647fe 100644 --- a/reference/stack/stack/swap.md +++ b/reference/stack/stack/swap.md @@ -96,3 +96,5 @@ 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) +- [LWG Issue 1198. Container adaptor `swap`: member or non-member?](https://cplusplus.github.io/LWG/issue1198) + - C++11で、メンバ`swap()`の効果が、基となるコンテナのメンバ`swap()`の呼び出しから、非修飾の`swap()`呼び出し (ADLによる探索を含む) へ改められた From 6069a084464b4975eee99191af542cf964070738 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:55:20 +0900 Subject: [PATCH 050/147] =?UTF-8?q?scoped=5Fallocator=5Fadaptor=E3=81=AE?= =?UTF-8?q?=E7=AD=89=E5=80=A4=E6=AF=94=E8=BC=83=20:=20LWG=20Issue=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 --- .../scoped_allocator/scoped_allocator_adaptor/op_equal.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/scoped_allocator/scoped_allocator_adaptor/op_equal.md b/reference/scoped_allocator/scoped_allocator_adaptor/op_equal.md index db9124a9cf..d526a8c7df 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor/op_equal.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor/op_equal.md @@ -74,3 +74,8 @@ equal - [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [LWG Issue 1316. `scoped_allocator_adaptor` `operator==` has no definition](https://cplusplus.github.io/LWG/issue1316) + - C++11で、この演算子の定義が追加された。宣言のみで意味が規定されていなかった From 8292167cc19753574cb9ce31b0542f9b8f5609ad Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:55:52 +0900 Subject: [PATCH 051/147] =?UTF-8?q?regex=20:=20LWG=20Issue=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/regex/basic_regex.md | 7 +++++++ reference/regex/basic_regex/assign.md | 2 ++ reference/regex/basic_regex/op_assign.md | 9 +++++++++ reference/regex/basic_regex/op_constructor.md | 2 ++ reference/regex/match_results/op_assign.md | 2 ++ reference/regex/match_results/op_constructor.md | 2 ++ reference/regex/regex_replace.md | 4 +++- reference/regex/regex_token_iterator/op_constructor.md | 2 ++ reference/regex/regex_traits/isctype.md | 2 ++ reference/regex/sub_match.md | 2 ++ reference/regex/sub_match/op_equal.md | 2 ++ reference/regex/sub_match/op_greater.md | 2 ++ reference/regex/sub_match/op_greater_equal.md | 2 ++ reference/regex/sub_match/op_less.md | 2 ++ reference/regex/sub_match/op_less_equal.md | 2 ++ reference/regex/sub_match/op_not_equal.md | 2 ++ 16 files changed, 45 insertions(+), 1 deletion(-) diff --git a/reference/regex/basic_regex.md b/reference/regex/basic_regex.md index 18613adacb..399ee73754 100644 --- a/reference/regex/basic_regex.md +++ b/reference/regex/basic_regex.md @@ -148,3 +148,10 @@ 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): ?? + + +## 参照 +- [LWG Issue 2001. Class template `basic_regex` uses non existent `string_type`](https://cplusplus.github.io/LWG/issue2001) + - C++11で、メンバ型`traits_type`と`string_type`が追加された。ほかの箇所でこれらの型名が使われていたが、定義されていなかった +- [LWG Issue 2029. Missing '`noexcept`' on `basic_regex` move-assignment operator](https://cplusplus.github.io/LWG/issue2029) + - C++11で、ムーブ代入演算子に`noexcept`が付加された diff --git a/reference/regex/basic_regex/assign.md b/reference/regex/basic_regex/assign.md index 7141c2a951..d6d45e0d75 100644 --- a/reference/regex/basic_regex/assign.md +++ b/reference/regex/basic_regex/assign.md @@ -134,3 +134,5 @@ 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)の経緯となる提案文書 +- [LWG Issue 723. `basic_regex` should be moveable](https://cplusplus.github.io/LWG/issue723) + - C++11で、ムーブコンストラクタ、ムーブ代入演算子、`assign()`のムーブ版が追加された diff --git a/reference/regex/basic_regex/op_assign.md b/reference/regex/basic_regex/op_assign.md index d039241b4a..36a7b5b78e 100644 --- a/reference/regex/basic_regex/op_assign.md +++ b/reference/regex/basic_regex/op_assign.md @@ -97,3 +97,12 @@ true ### 備考 Clang バージョン 3.0 は [`initializer_list`](../../initializer_list.md) に対応していないため、(4) の形式は提供されていない。 また、Clang(libc++) では例外が発生した場合に `*this` が元の状態を保持せずに中途半端に更新されてしまう。 + + +## 参照 +- [LWG Issue 723. `basic_regex` should be moveable](https://cplusplus.github.io/LWG/issue723) + - C++11で、ムーブコンストラクタ、ムーブ代入演算子、`assign()`のムーブ版が追加された +- [LWG Issue 1014. `basic_regex` should be created/assigned from initializer lists](https://cplusplus.github.io/LWG/issue1014) + - C++11で、[`initializer_list`](/reference/initializer_list/initializer_list.md)``からの代入演算子が追加された +- [LWG Issue 2029. Missing '`noexcept`' on `basic_regex` move-assignment operator](https://cplusplus.github.io/LWG/issue2029) + - C++11で、ムーブ代入演算子に`noexcept`が付加された diff --git a/reference/regex/basic_regex/op_constructor.md b/reference/regex/basic_regex/op_constructor.md index 70b480e0e3..bdaef7eb25 100644 --- a/reference/regex/basic_regex/op_constructor.md +++ b/reference/regex/basic_regex/op_constructor.md @@ -147,3 +147,5 @@ 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)の経緯となる提案文書 +- [LWG Issue 723. `basic_regex` should be moveable](https://cplusplus.github.io/LWG/issue723) + - C++11で、ムーブコンストラクタ、ムーブ代入演算子、`assign()`のムーブ版が追加された diff --git a/reference/regex/match_results/op_assign.md b/reference/regex/match_results/op_assign.md index e796934a23..d1b6cd39b2 100644 --- a/reference/regex/match_results/op_assign.md +++ b/reference/regex/match_results/op_assign.md @@ -138,5 +138,7 @@ GCC(libstdc++) の 4.9.2 までは、アロケータが上記の事後条件の ## 参照 +- [LWG Issue 1209. `match_results` should be moveable](https://cplusplus.github.io/LWG/issue1209) + - C++11で、ムーブコンストラクタとムーブ代入演算子が追加された - [LWG Issue 2184. Muddled allocator requirements for `match_results` assignments](https://cplusplus.github.io/LWG/issue2184) - コピー代入・ムーブ代入がサポートされることが明確化された。C++11時点の規格は、クラス概要でコピー代入・ムーブ代入演算子を宣言する一方、要件の除外句が「const修飾されたシーケンスコンテナの操作のみサポート」と読め、両者が矛盾していた。この修正はC++20に取り込まれたが、矛盾した文言を正すものであり、演算子自体はC++11から存在してアロケータ対応コンテナの規則に従うため、実装の挙動は変わらない(欠陥修正のため処理系は早期に対応している) diff --git a/reference/regex/match_results/op_constructor.md b/reference/regex/match_results/op_constructor.md index e2c6bb7f70..7675dac133 100644 --- a/reference/regex/match_results/op_constructor.md +++ b/reference/regex/match_results/op_constructor.md @@ -164,6 +164,8 @@ GCC(libstdc++) の 4.9.2 までは、[`regex_iterator`](../regex_iterator.md) ## 参照 - [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 1209. `match_results` should be moveable](https://cplusplus.github.io/LWG/issue1209) + - C++11で、ムーブコンストラクタとムーブ代入演算子が追加された - [LWG Issue 2183. Muddled allocator requirements for `match_results` constructors](https://cplusplus.github.io/LWG/issue2183) - コンストラクタの曖昧なアロケータ要件が整理され、コピー時は`select_on_container_copy_construction`でアロケータを取得し、ムーブ時はアロケータをムーブ構築することが明確化された。この修正はC++20に取り込まれたが、`match_results`はC++11からアロケータ対応コンテナであり、これらのアロケータの扱いはその規則から従うものであるため、実装の挙動は変わらない(欠陥修正のため処理系は早期に対応している) - [LWG Issue 2195. Missing constructors for `match_results`](https://cplusplus.github.io/LWG/issue2195) diff --git a/reference/regex/regex_replace.md b/reference/regex/regex_replace.md index 97adb92ac2..b863bb859c 100644 --- a/reference/regex/regex_replace.md +++ b/reference/regex/regex_replace.md @@ -244,4 +244,6 @@ int main() ## 参照 -* [C++の正規表現ライブラリ: std::regex | 本の虫](https://cpplover.blogspot.jp/2015/01/c-stdregex.html) +- [C++の正規表現ライブラリ: std::regex | 本の虫](https://cpplover.blogspot.jp/2015/01/c-stdregex.html) +- [LWG Issue 727. `regex_replace()` doesn't accept `basic_strings` with custom traits and allocators](https://cplusplus.github.io/LWG/issue727) + - C++11で、`fmt`および`s`に指定する[`basic_string`](/reference/string/basic_string.md)の`traits`とアロケータを任意に指定できるよう、テンプレートパラメータが追加された diff --git a/reference/regex/regex_token_iterator/op_constructor.md b/reference/regex/regex_token_iterator/op_constructor.md index fb5b399478..3e45ca4d0b 100644 --- a/reference/regex/regex_token_iterator/op_constructor.md +++ b/reference/regex/regex_token_iterator/op_constructor.md @@ -166,5 +166,7 @@ match range = (67, 73), str = 'value3' ## 参照 +- [LWG Issue 909. `regex_token_iterator` should use `initializer_list`](https://cplusplus.github.io/LWG/issue909) + - C++11で、部分マッチ番号を[`initializer_list`](/reference/initializer_list/initializer_list.md)``で受け取るコンストラクタが追加された。`vector`とC配列を受け取るオーバーロードはあったが、波カッコで直接指定できなかったため - [LWG Issue 3129. `regex_token_iterator` constructor uses wrong pointer arithmetic](https://cplusplus.github.io/LWG/issue3129) - C++20で、配列を受け取るコンストラクタの効果における範囲指定が、配列全体への誤ったポインタ演算から`[begin(submatches), end(submatches))`に修正された diff --git a/reference/regex/regex_traits/isctype.md b/reference/regex/regex_traits/isctype.md index 750a362d1b..6518343f94 100644 --- a/reference/regex/regex_traits/isctype.md +++ b/reference/regex/regex_traits/isctype.md @@ -64,5 +64,7 @@ int main() ## 参照 +- [LWG Issue 1337. Swapped arguments in `regex_traits::isctype`](https://cplusplus.github.io/LWG/issue1337) + - C++11で、[`ctype::is()`](/reference/locale/ctype/is.md)に渡す引数の順序が`is(c, m)`から`is(m, c)`へ修正された - [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/sub_match.md b/reference/regex/sub_match.md index 3913db992d..4957317dc7 100644 --- a/reference/regex/sub_match.md +++ b/reference/regex/sub_match.md @@ -131,5 +131,7 @@ int main() ## 参照 +- [LWG Issue 1180. Missing `string_type` member typedef in class `sub_match`](https://cplusplus.github.io/LWG/issue1180) + - C++11で、メンバ型`string_type`が追加された。`str()`と`operator string_type()`が返す型を参照できるようにするため - [LWG Issue 3204. `sub_match::swap` only swaps the base class](https://cplusplus.github.io/LWG/issue3204) - C++23で、メンバ変数`matched`も交換する専用のメンバ関数`swap`が追加された diff --git a/reference/regex/sub_match/op_equal.md b/reference/regex/sub_match/op_equal.md index 29fadb91a2..33b3b9772a 100644 --- a/reference/regex/sub_match/op_equal.md +++ b/reference/regex/sub_match/op_equal.md @@ -135,3 +135,5 @@ false ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [LWG Issue 1181. Invalid `sub_match` comparison operators](https://cplusplus.github.io/LWG/issue1181) + - C++11で、文字列や文字と比較するオーバーロードが[`compare()`](compare.md)を用いる形へ改められた。`str()`との比較では文字列の`traits`が考慮されず、また一時オブジェクトの生成が必要だったため diff --git a/reference/regex/sub_match/op_greater.md b/reference/regex/sub_match/op_greater.md index 09cc94e8ad..17c1c581bb 100644 --- a/reference/regex/sub_match/op_greater.md +++ b/reference/regex/sub_match/op_greater.md @@ -126,3 +126,5 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [LWG Issue 1181. Invalid `sub_match` comparison operators](https://cplusplus.github.io/LWG/issue1181) + - C++11で、文字列や文字と比較するオーバーロードが[`compare()`](compare.md)を用いる形へ改められた。`str()`との比較では文字列の`traits`が考慮されず、また一時オブジェクトの生成が必要だったため diff --git a/reference/regex/sub_match/op_greater_equal.md b/reference/regex/sub_match/op_greater_equal.md index 48363e2aca..81ea4148f7 100644 --- a/reference/regex/sub_match/op_greater_equal.md +++ b/reference/regex/sub_match/op_greater_equal.md @@ -126,3 +126,5 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [LWG Issue 1181. Invalid `sub_match` comparison operators](https://cplusplus.github.io/LWG/issue1181) + - C++11で、文字列や文字と比較するオーバーロードが[`compare()`](compare.md)を用いる形へ改められた。`str()`との比較では文字列の`traits`が考慮されず、また一時オブジェクトの生成が必要だったため diff --git a/reference/regex/sub_match/op_less.md b/reference/regex/sub_match/op_less.md index 6f4c0ce251..18b9e9f7ce 100644 --- a/reference/regex/sub_match/op_less.md +++ b/reference/regex/sub_match/op_less.md @@ -132,3 +132,5 @@ false ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [LWG Issue 1181. Invalid `sub_match` comparison operators](https://cplusplus.github.io/LWG/issue1181) + - C++11で、文字列や文字と比較するオーバーロードが[`compare()`](compare.md)を用いる形へ改められた。`str()`との比較では文字列の`traits`が考慮されず、また一時オブジェクトの生成が必要だったため diff --git a/reference/regex/sub_match/op_less_equal.md b/reference/regex/sub_match/op_less_equal.md index 38d512a015..2a0f3fd6a3 100644 --- a/reference/regex/sub_match/op_less_equal.md +++ b/reference/regex/sub_match/op_less_equal.md @@ -125,3 +125,5 @@ false ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [LWG Issue 1181. Invalid `sub_match` comparison operators](https://cplusplus.github.io/LWG/issue1181) + - C++11で、文字列や文字と比較するオーバーロードが[`compare()`](compare.md)を用いる形へ改められた。`str()`との比較では文字列の`traits`が考慮されず、また一時オブジェクトの生成が必要だったため diff --git a/reference/regex/sub_match/op_not_equal.md b/reference/regex/sub_match/op_not_equal.md index cf9eacb739..13e15ab82b 100644 --- a/reference/regex/sub_match/op_not_equal.md +++ b/reference/regex/sub_match/op_not_equal.md @@ -125,3 +125,5 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [LWG Issue 1181. Invalid `sub_match` comparison operators](https://cplusplus.github.io/LWG/issue1181) + - C++11で、文字列や文字と比較するオーバーロードが[`compare()`](compare.md)を用いる形へ改められた。`str()`との比較では文字列の`traits`が考慮されず、また一時オブジェクトの生成が必要だったため From e3f5df838e902536ff987e22958d9baaf2d8570e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:57:28 +0900 Subject: [PATCH 052/147] =?UTF-8?q?ratio=20:=20=E8=A6=81=E4=BB=B6=E3=82=92?= =?UTF-8?q?=E9=81=A9=E6=A0=BC=E8=A6=81=E4=BB=B6=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/ratio/ratio.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/reference/ratio/ratio.md b/reference/ratio/ratio.md index 78d2c08e8d..c797180f73 100644 --- a/reference/ratio/ratio.md +++ b/reference/ratio/ratio.md @@ -25,8 +25,8 @@ namespace std { - `num` : [`sign`](https://ja.wikipedia.org/wiki/符号関数)`(N) *` [`sign`](https://ja.wikipedia.org/wiki/符号関数)`(D) *` [`abs`](/reference/cmath/abs.md)`(N) /` [`gcd`](https://ja.wikipedia.org/wiki/最大公約数)`(N, D)` - `den` : [`abs`](/reference/cmath/abs.md)`(D) /` [`gcd`](https://ja.wikipedia.org/wiki/最大公約数)`(N, D)` -## 要件 -`den`の値が`0`でもなく、[`intmax_t`](/reference/cstdint/intmax_t.md)の最小値でもないこと。 +## 適格要件 +- `den`の値が`0`でもなく、[`intmax_t`](/reference/cstdint/intmax_t.md)の最小値でもないこと。 ## 例 @@ -55,3 +55,12 @@ 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): ?? + + +## 参照 +- [LWG Issue 921. Rational Arithmetic should use template aliases](https://cplusplus.github.io/LWG/issue921) + - C++11で、`ratio`の算術演算がクラステンプレートからエイリアステンプレートへ改められ、[`ratio`](ratio.md)にネストされた型`type`が追加された。演算結果が既約化された`ratio`そのものとして扱えるようにするため +- [LWG Issue 1195. "Diagnostic required" wording is insufficient to prevent UB](https://cplusplus.github.io/LWG/issue1195) + - C++11で、テンプレート引数が要件を満たさない場合の扱いが、診断が必要な要件違反から、プログラムが不適格となる規定へ改められた +- [LWG Issue 1388. LWG 1281 incorrectly accepted](https://cplusplus.github.io/LWG/issue1388) + - C++11で、ネストされた型`type`が`ratio`として定義されることが規定された From 7b1a18ed3ee9c4b6c6f37b35a1f1ce4f7c26d39c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:57:49 +0900 Subject: [PATCH 053/147] =?UTF-8?q?ratio=E3=81=AE=E6=BC=94=E7=AE=97?= =?UTF-8?q?=E3=83=A1=E3=82=BF=E9=96=A2=E6=95=B0=20:=20LWG=20Issue=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/ratio/ratio_add.md | 7 +++++++ reference/ratio/ratio_divide.md | 7 +++++++ reference/ratio/ratio_multiply.md | 4 ++++ reference/ratio/ratio_subtract.md | 7 +++++++ 4 files changed, 25 insertions(+) diff --git a/reference/ratio/ratio_add.md b/reference/ratio/ratio_add.md index 66846f715a..870b43ac54 100644 --- a/reference/ratio/ratio_add.md +++ b/reference/ratio/ratio_add.md @@ -51,3 +51,10 @@ 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): ?? + + +## 参照 +- [LWG Issue 921. Rational Arithmetic should use template aliases](https://cplusplus.github.io/LWG/issue921) + - C++11で、`ratio`の算術演算がクラステンプレートからエイリアステンプレートへ改められ、[`ratio`](ratio.md)にネストされた型`type`が追加された。演算結果が既約化された`ratio`そのものとして扱えるようにするため +- [LWG Issue 948. `ratio` arithmetic tweak](https://cplusplus.github.io/LWG/issue948) + - C++11で、処理系がオーバーフローを避けるために別のアルゴリズムを使ってよいこと、オーバーフローが起きた場合は診断が必要であることが明記された diff --git a/reference/ratio/ratio_divide.md b/reference/ratio/ratio_divide.md index 2030da4f5d..1ed519d80d 100644 --- a/reference/ratio/ratio_divide.md +++ b/reference/ratio/ratio_divide.md @@ -51,3 +51,10 @@ 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): ?? + + +## 参照 +- [LWG Issue 921. Rational Arithmetic should use template aliases](https://cplusplus.github.io/LWG/issue921) + - C++11で、`ratio`の算術演算がクラステンプレートからエイリアステンプレートへ改められ、[`ratio`](ratio.md)にネストされた型`type`が追加された。演算結果が既約化された`ratio`そのものとして扱えるようにするため +- [LWG Issue 948. `ratio` arithmetic tweak](https://cplusplus.github.io/LWG/issue948) + - C++11で、処理系がオーバーフローを避けるために別のアルゴリズムを使ってよいこと、オーバーフローが起きた場合は診断が必要であることが明記された diff --git a/reference/ratio/ratio_multiply.md b/reference/ratio/ratio_multiply.md index 69c2b5b9ec..0d6f014f5a 100644 --- a/reference/ratio/ratio_multiply.md +++ b/reference/ratio/ratio_multiply.md @@ -86,3 +86,7 @@ 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) +- [LWG Issue 921. Rational Arithmetic should use template aliases](https://cplusplus.github.io/LWG/issue921) + - C++11で、`ratio`の算術演算がクラステンプレートからエイリアステンプレートへ改められ、[`ratio`](ratio.md)にネストされた型`type`が追加された。演算結果が既約化された`ratio`そのものとして扱えるようにするため +- [LWG Issue 948. `ratio` arithmetic tweak](https://cplusplus.github.io/LWG/issue948) + - C++11で、処理系がオーバーフローを避けるために別のアルゴリズムを使ってよいこと、オーバーフローが起きた場合は診断が必要であることが明記された diff --git a/reference/ratio/ratio_subtract.md b/reference/ratio/ratio_subtract.md index 851aa00688..3688613326 100644 --- a/reference/ratio/ratio_subtract.md +++ b/reference/ratio/ratio_subtract.md @@ -51,3 +51,10 @@ 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): ?? + + +## 参照 +- [LWG Issue 921. Rational Arithmetic should use template aliases](https://cplusplus.github.io/LWG/issue921) + - C++11で、`ratio`の算術演算がクラステンプレートからエイリアステンプレートへ改められ、[`ratio`](ratio.md)にネストされた型`type`が追加された。演算結果が既約化された`ratio`そのものとして扱えるようにするため +- [LWG Issue 948. `ratio` arithmetic tweak](https://cplusplus.github.io/LWG/issue948) + - C++11で、処理系がオーバーフローを避けるために別のアルゴリズムを使ってよいこと、オーバーフローが起きた場合は診断が必要であることが明記された From df1e106679b6dee63cce758e82e277e6413e09a8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:58:56 +0900 Subject: [PATCH 054/147] =?UTF-8?q?random=20:=20LWG=20Issue=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/random/discard_block_engine/base.md | 2 ++ reference/random/discard_block_engine/op_constructor.md | 2 ++ reference/random/discard_block_engine/seed.md | 2 ++ reference/random/independent_bits_engine/base.md | 2 ++ .../random/independent_bits_engine/op_constructor.md | 2 ++ reference/random/independent_bits_engine/seed.md | 2 ++ .../random/linear_congruential_engine/op_constructor.md | 2 ++ reference/random/linear_congruential_engine/seed.md | 2 ++ reference/random/mersenne_twister_engine.md | 8 +++++--- .../random/mersenne_twister_engine/op_constructor.md | 2 ++ reference/random/mersenne_twister_engine/seed.md | 2 ++ .../random/piecewise_constant_distribution/densities.md | 2 ++ .../random/piecewise_linear_distribution/densities.md | 2 ++ .../piecewise_linear_distribution/op_constructor.md | 4 +++- reference/random/shuffle_order_engine/base.md | 2 ++ reference/random/shuffle_order_engine/op_constructor.md | 2 ++ reference/random/shuffle_order_engine/seed.md | 2 ++ .../random/subtract_with_carry_engine/op_constructor.md | 2 ++ reference/random/subtract_with_carry_engine/seed.md | 2 ++ 19 files changed, 42 insertions(+), 4 deletions(-) diff --git a/reference/random/discard_block_engine/base.md b/reference/random/discard_block_engine/base.md index b1c14f280d..32e1ff1960 100644 --- a/reference/random/discard_block_engine/base.md +++ b/reference/random/discard_block_engine/base.md @@ -50,3 +50,5 @@ int main() ## 参照 +- [LWG Issue 1438. No definition for `base()`](https://cplusplus.github.io/LWG/issue1438) + - C++11で、乱数エンジンアダプタの要件に`base()`の規定が追加された。各アダプタの宣言にはあったが、意味が規定されていなかった diff --git a/reference/random/discard_block_engine/op_constructor.md b/reference/random/discard_block_engine/op_constructor.md index 24da9e4faa..0c2d83d26f 100644 --- a/reference/random/discard_block_engine/op_constructor.md +++ b/reference/random/discard_block_engine/op_constructor.md @@ -119,3 +119,5 @@ int main() ## 参照 +- [LWG Issue 1436. Random number engine constructor concerns](https://cplusplus.github.io/LWG/issue1436) + - C++11で、シードシーケンスをとるコンストラクタが、`Sseq`がシードシーケンスとして適格でない型である場合にオーバーロード解決に参加しないよう規定された。適格でないと判定する型の範囲は未規定だが、少なくとも`result_type`へ暗黙変換可能な型はシードシーケンスとみなさない。整数のシードを渡したときに、こちらが選ばれてしまわないようにするため diff --git a/reference/random/discard_block_engine/seed.md b/reference/random/discard_block_engine/seed.md index 581700be15..935ad00a0c 100644 --- a/reference/random/discard_block_engine/seed.md +++ b/reference/random/discard_block_engine/seed.md @@ -112,3 +112,5 @@ int main() ## 参照 +- [LWG Issue 1436. Random number engine constructor concerns](https://cplusplus.github.io/LWG/issue1436) + - C++11で、シードシーケンスをとるこの関数が、`Sseq`がシードシーケンスとして適格でない型である場合にオーバーロード解決に参加しないよう規定された。整数のシードを渡したときに、こちらが選ばれてしまわないようにするため diff --git a/reference/random/independent_bits_engine/base.md b/reference/random/independent_bits_engine/base.md index 7c85326bb8..18d956ee2b 100644 --- a/reference/random/independent_bits_engine/base.md +++ b/reference/random/independent_bits_engine/base.md @@ -49,3 +49,5 @@ int main() ## 参照 +- [LWG Issue 1438. No definition for `base()`](https://cplusplus.github.io/LWG/issue1438) + - C++11で、乱数エンジンアダプタの要件に`base()`の規定が追加された。各アダプタの宣言にはあったが、意味が規定されていなかった diff --git a/reference/random/independent_bits_engine/op_constructor.md b/reference/random/independent_bits_engine/op_constructor.md index 94ebbaaa7c..2c01dfc2cf 100644 --- a/reference/random/independent_bits_engine/op_constructor.md +++ b/reference/random/independent_bits_engine/op_constructor.md @@ -120,3 +120,5 @@ int main() ## 参照 +- [LWG Issue 1436. Random number engine constructor concerns](https://cplusplus.github.io/LWG/issue1436) + - C++11で、シードシーケンスをとるコンストラクタが、`Sseq`がシードシーケンスとして適格でない型である場合にオーバーロード解決に参加しないよう規定された。適格でないと判定する型の範囲は未規定だが、少なくとも`result_type`へ暗黙変換可能な型はシードシーケンスとみなさない。整数のシードを渡したときに、こちらが選ばれてしまわないようにするため diff --git a/reference/random/independent_bits_engine/seed.md b/reference/random/independent_bits_engine/seed.md index 3299c02c8f..b0548fbb10 100644 --- a/reference/random/independent_bits_engine/seed.md +++ b/reference/random/independent_bits_engine/seed.md @@ -112,3 +112,5 @@ int main() ## 参照 +- [LWG Issue 1436. Random number engine constructor concerns](https://cplusplus.github.io/LWG/issue1436) + - C++11で、シードシーケンスをとるこの関数が、`Sseq`がシードシーケンスとして適格でない型である場合にオーバーロード解決に参加しないよう規定された。整数のシードを渡したときに、こちらが選ばれてしまわないようにするため diff --git a/reference/random/linear_congruential_engine/op_constructor.md b/reference/random/linear_congruential_engine/op_constructor.md index 5390772508..04b19af0c3 100644 --- a/reference/random/linear_congruential_engine/op_constructor.md +++ b/reference/random/linear_congruential_engine/op_constructor.md @@ -103,3 +103,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) +- [LWG Issue 1436. Random number engine constructor concerns](https://cplusplus.github.io/LWG/issue1436) + - C++11で、シードシーケンスをとるコンストラクタが、`Sseq`がシードシーケンスとして適格でない型である場合にオーバーロード解決に参加しないよう規定された。適格でないと判定する型の範囲は未規定だが、少なくとも`result_type`へ暗黙変換可能な型はシードシーケンスとみなさない。整数のシードを渡したときに、こちらが選ばれてしまわないようにするため diff --git a/reference/random/linear_congruential_engine/seed.md b/reference/random/linear_congruential_engine/seed.md index 811b0535dc..0b73023aec 100644 --- a/reference/random/linear_congruential_engine/seed.md +++ b/reference/random/linear_congruential_engine/seed.md @@ -107,3 +107,5 @@ int main() ## 参照 +- [LWG Issue 1436. Random number engine constructor concerns](https://cplusplus.github.io/LWG/issue1436) + - C++11で、シードシーケンスをとるこの関数が、`Sseq`がシードシーケンスとして適格でない型である場合にオーバーロード解決に参加しないよう規定された。整数のシードを渡したときに、こちらが選ばれてしまわないようにするため diff --git a/reference/random/mersenne_twister_engine.md b/reference/random/mersenne_twister_engine.md index a61680d125..8ab0087c55 100644 --- a/reference/random/mersenne_twister_engine.md +++ b/reference/random/mersenne_twister_engine.md @@ -176,8 +176,10 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 -* [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`クラスが実装されている +- [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`クラスが実装されている +- [LWG Issue 1437. Mersenne twister meaningless for word sizes less than two](https://cplusplus.github.io/LWG/issue1437) + - C++11の策定時に、テンプレートパラメータが満たすべき関係式に`2u < w`が追加された。ワードサイズが小さすぎると意味のある生成ができないため - [P4037R1 Supporting `signed char` and `unsigned char` in random number generation](https://open-std.org/jtc1/sc22/wg21/docs/papers/2026/p4037r1.html) - `UIntType`テンプレートパラメータの要件が明文化された(拡張符号なし整数型および処理系定義のサブセットを許容)。この仕様はC++26から導入されたが、仕様の欠陥を修正したものであるためコンパイラは早期に対応している場合がある diff --git a/reference/random/mersenne_twister_engine/op_constructor.md b/reference/random/mersenne_twister_engine/op_constructor.md index 065b57f1f6..8702c90b17 100644 --- a/reference/random/mersenne_twister_engine/op_constructor.md +++ b/reference/random/mersenne_twister_engine/op_constructor.md @@ -105,3 +105,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) +- [LWG Issue 1436. Random number engine constructor concerns](https://cplusplus.github.io/LWG/issue1436) + - C++11で、シードシーケンスをとるコンストラクタが、`Sseq`がシードシーケンスとして適格でない型である場合にオーバーロード解決に参加しないよう規定された。適格でないと判定する型の範囲は未規定だが、少なくとも`result_type`へ暗黙変換可能な型はシードシーケンスとみなさない。整数のシードを渡したときに、こちらが選ばれてしまわないようにするため diff --git a/reference/random/mersenne_twister_engine/seed.md b/reference/random/mersenne_twister_engine/seed.md index 49a3cc9baf..8357ff612d 100644 --- a/reference/random/mersenne_twister_engine/seed.md +++ b/reference/random/mersenne_twister_engine/seed.md @@ -108,3 +108,5 @@ int main() ## 参照 +- [LWG Issue 1436. Random number engine constructor concerns](https://cplusplus.github.io/LWG/issue1436) + - C++11で、シードシーケンスをとるこの関数が、`Sseq`がシードシーケンスとして適格でない型である場合にオーバーロード解決に参加しないよう規定された。整数のシードを渡したときに、こちらが選ばれてしまわないようにするため diff --git a/reference/random/piecewise_constant_distribution/densities.md b/reference/random/piecewise_constant_distribution/densities.md index da0137c4cd..d658008440 100644 --- a/reference/random/piecewise_constant_distribution/densities.md +++ b/reference/random/piecewise_constant_distribution/densities.md @@ -64,3 +64,5 @@ int main() ## 参照 +- [LWG Issue 1439. Return from `densities()` functions?](https://cplusplus.github.io/LWG/issue1439) + - C++11で、戻り値の型が[`vector`](/reference/vector/vector.md)``から[`vector`](/reference/vector/vector.md)``へ改められた diff --git a/reference/random/piecewise_linear_distribution/densities.md b/reference/random/piecewise_linear_distribution/densities.md index 410a90b050..a10108f5e9 100644 --- a/reference/random/piecewise_linear_distribution/densities.md +++ b/reference/random/piecewise_linear_distribution/densities.md @@ -65,3 +65,5 @@ int main() ## 参照 +- [LWG Issue 1439. Return from `densities()` functions?](https://cplusplus.github.io/LWG/issue1439) + - C++11で、戻り値の型が[`vector`](/reference/vector/vector.md)``から[`vector`](/reference/vector/vector.md)``へ改められた diff --git a/reference/random/piecewise_linear_distribution/op_constructor.md b/reference/random/piecewise_linear_distribution/op_constructor.md index 361b23e598..ad0d3f1076 100644 --- a/reference/random/piecewise_linear_distribution/op_constructor.md +++ b/reference/random/piecewise_linear_distribution/op_constructor.md @@ -34,7 +34,7 @@ explicit piecewise_linear_distribution(const param_type& parm); // (5) - 重み付け数列は、`[bl.begin(), bl.end())`の各要素`b`に対し、式`fw(b)`で返された重みから構築する。 - (4) : 区間値の範囲を受け取るコンストラクタ。 - `nw`は区間列の要素数、`xmin`は区間の最小値、`xmax`は区間の最大値、`fw`は区間列それぞれのインデックスに対する重み値を求めるための単項関数オブジェクトである。`UnaryOperation`関数オブジェクトは、`double`型に変換可能な区間値を受け取り、その区間に対する確率値を返す。 - - 以下の公式で確率列を構築する。δの値を`0 < δ = (xmax−xmin)/n`として、`k番目の確率 = fw(xmin + k)`。 + - 以下の公式で確率列を構築する。`δ = (xmax − xmin) / nw`として、`k`番目の区間の境界を`b_k = xmin + k・δ` (`k = 0, …, nw`)、`k`番目の重みを`w_k = fw(b_k)`とする。 - `nw`が1以下だった場合、区間数列を`{0.0, 1.0}`、重み数列を`{1.0, 1.0}`として構築し、`[0.0, 1.0)`の一様分布とする。 - (5) : パラメータオブジェクトを受け取るコンストラクタ。`param_type`は、このクラスの(5)以外のコンストラクタと同じオーバーロードを持ち、それらのコンストラクタのパラメータを保持している。このコンストラクタでは、`param`オブジェクトが持っているパラメータを、このクラスのコンストラクタに転送する。 @@ -151,3 +151,5 @@ parameter constructor : 0.260002 ## 参照 +- [LWG Issue 1440. Incorrect specification for `piecewise_linear_distribution`](https://cplusplus.github.io/LWG/issue1440) + - C++11の策定時に、(4)における重みの計算式が`fw(b_k + δ)`から`fw(b_k)`へ修正された。各境界そのものでの値を使うべきところが、ひとつ先へずれていた diff --git a/reference/random/shuffle_order_engine/base.md b/reference/random/shuffle_order_engine/base.md index 37e0c1494d..1fc34094c1 100644 --- a/reference/random/shuffle_order_engine/base.md +++ b/reference/random/shuffle_order_engine/base.md @@ -50,3 +50,5 @@ int main() ## 参照 +- [LWG Issue 1438. No definition for `base()`](https://cplusplus.github.io/LWG/issue1438) + - C++11で、乱数エンジンアダプタの要件に`base()`の規定が追加された。各アダプタの宣言にはあったが、意味が規定されていなかった diff --git a/reference/random/shuffle_order_engine/op_constructor.md b/reference/random/shuffle_order_engine/op_constructor.md index 0161b6c1cc..a2906bf839 100644 --- a/reference/random/shuffle_order_engine/op_constructor.md +++ b/reference/random/shuffle_order_engine/op_constructor.md @@ -119,3 +119,5 @@ int main() ## 参照 +- [LWG Issue 1436. Random number engine constructor concerns](https://cplusplus.github.io/LWG/issue1436) + - C++11で、シードシーケンスをとるコンストラクタが、`Sseq`がシードシーケンスとして適格でない型である場合にオーバーロード解決に参加しないよう規定された。適格でないと判定する型の範囲は未規定だが、少なくとも`result_type`へ暗黙変換可能な型はシードシーケンスとみなさない。整数のシードを渡したときに、こちらが選ばれてしまわないようにするため diff --git a/reference/random/shuffle_order_engine/seed.md b/reference/random/shuffle_order_engine/seed.md index c52834241f..51c68335cc 100644 --- a/reference/random/shuffle_order_engine/seed.md +++ b/reference/random/shuffle_order_engine/seed.md @@ -112,3 +112,5 @@ int main() ## 参照 +- [LWG Issue 1436. Random number engine constructor concerns](https://cplusplus.github.io/LWG/issue1436) + - C++11で、シードシーケンスをとるこの関数が、`Sseq`がシードシーケンスとして適格でない型である場合にオーバーロード解決に参加しないよう規定された。整数のシードを渡したときに、こちらが選ばれてしまわないようにするため diff --git a/reference/random/subtract_with_carry_engine/op_constructor.md b/reference/random/subtract_with_carry_engine/op_constructor.md index cbccd9ebfc..52811237a5 100644 --- a/reference/random/subtract_with_carry_engine/op_constructor.md +++ b/reference/random/subtract_with_carry_engine/op_constructor.md @@ -111,6 +111,8 @@ 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) +- [LWG Issue 1436. Random number engine constructor concerns](https://cplusplus.github.io/LWG/issue1436) + - C++11で、シードシーケンスをとるコンストラクタが、`Sseq`がシードシーケンスとして適格でない型である場合にオーバーロード解決に参加しないよう規定された。適格でないと判定する型の範囲は未規定だが、少なくとも`result_type`へ暗黙変換可能な型はシードシーケンスとみなさない。整数のシードを渡したときに、こちらが選ばれてしまわないようにするため - [LWG Issue 3809. Is `std::subtract_with_carry_engine` supposed to work?](https://cplusplus.github.io/LWG/issue3809) - [LWG Issue 4014. LWG 3809 changes behavior of some existing `std::subtract_with_carry_engine` code](https://cplusplus.github.io/LWG/issue4014) - C++26で、内部状態の初期化に用いる線形合同法エンジンの呼び出し回数が $\lceil 32 / \mathtt{w} \rceil$ から $\lceil \mathtt{w} / 32 \rceil$ に修正された(LWG 3809が既存コードの生成列を変えてしまった問題の修正) diff --git a/reference/random/subtract_with_carry_engine/seed.md b/reference/random/subtract_with_carry_engine/seed.md index feac39b096..d9d192641d 100644 --- a/reference/random/subtract_with_carry_engine/seed.md +++ b/reference/random/subtract_with_carry_engine/seed.md @@ -111,4 +111,6 @@ int main() ## 参照 +- [LWG Issue 1436. Random number engine constructor concerns](https://cplusplus.github.io/LWG/issue1436) + - C++11で、シードシーケンスをとるこの関数が、`Sseq`がシードシーケンスとして適格でない型である場合にオーバーロード解決に参加しないよう規定された。整数のシードを渡したときに、こちらが選ばれてしまわないようにするため - [LWG Issue 3809. Is `std::subtract_with_carry_engine` supposed to work?](https://cplusplus.github.io/LWG/issue3809) From a6c10201a0e427081f9ff9db835f7127a982cf97 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:59:16 +0900 Subject: [PATCH 055/147] =?UTF-8?q?priority=5Fqueue=20:=20LWG=20Issue?= =?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/queue/priority_queue/op_constructor.md | 6 +++++- reference/queue/priority_queue/swap.md | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/reference/queue/priority_queue/op_constructor.md b/reference/queue/priority_queue/op_constructor.md index a2d8c1e6be..550968a2cf 100644 --- a/reference/queue/priority_queue/op_constructor.md +++ b/reference/queue/priority_queue/op_constructor.md @@ -368,11 +368,15 @@ 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) +- [LWG Issue 1194. Unintended `queue` constructor](https://cplusplus.github.io/LWG/issue1194) + - C++11で、アロケータを受け取るコンストラクタ群が、[`uses_allocator`](/reference/memory/uses_allocator.md)`::value`が`true`である場合にのみオーバーロード解決に参加するよう制約された。制約がないと、`Alloc`にコンテナが構築可能な任意の型を渡せてしまい、`priority_queue q(5);`のような意図しない構築が通ってしまうため +- [LWG Issue 1199. Missing extended copy constructor in container adaptors](https://cplusplus.github.io/LWG/issue1199) + - C++11で、アロケータを指定する拡張コピーコンストラクタが追加された。ムーブ版は既に用意されていたが、コピー版が漏れていた - [LWG Issue 2537. Constructors for `priority_queue` taking allocators should call `make_heap`](https://cplusplus.github.io/LWG/issue2537) - C++17で、アロケータを受け取るコンストラクタでも`make_heap`を呼び出すことが明記された - この修正は欠陥報告(DR)であり、C++11以降に遡及して適用される。元の文言を厳密に読むと呼び出し側がヒープ化済みのコンテナを渡す必要があるという意図しない解釈になり、処理系は当初から`make_heap`を呼んでいたため +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) - [LWG Issue 3506. Missing allocator-extended constructors for `priority_queue`](https://cplusplus.github.io/LWG/issue3506) - C++23で、イテレータ範囲を受け取るアロケータ拡張コンストラクタ(15)〜(17)が追加された - [LWG Issue 3522. Missing requirement on `InputIterator` template parameter for `priority_queue` constructors](https://cplusplus.github.io/LWG/issue3522) - C++23で、イテレータ範囲を受け取るコンストラクタが、入力イテレータでない型が推論された場合にオーバーロード解決に参加しないという制約が追加された -- [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 6d2b0279b3..87abd46363 100644 --- a/reference/queue/priority_queue/swap.md +++ b/reference/queue/priority_queue/swap.md @@ -90,3 +90,5 @@ int main () ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 1198. Container adaptor `swap`: member or non-member?](https://cplusplus.github.io/LWG/issue1198) + - C++11で、メンバ`swap()`の効果が、基となるコンテナのメンバ`swap()`の呼び出しから、非修飾の`swap()`呼び出し (ADLによる探索を含む) へ改められた From e31cddd2bd9f34a77a34273090ca26c814da87ea Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 10:59:26 +0900 Subject: [PATCH 056/147] =?UTF-8?q?queue=20:=20LWG=20Issue=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/queue/queue/op_constructor.md | 4 ++++ reference/queue/queue/swap.md | 2 ++ 2 files changed, 6 insertions(+) diff --git a/reference/queue/queue/op_constructor.md b/reference/queue/queue/op_constructor.md index 51c3cb6cb0..2281fafd51 100644 --- a/reference/queue/queue/op_constructor.md +++ b/reference/queue/queue/op_constructor.md @@ -131,3 +131,7 @@ int main() { - [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) +- [LWG Issue 1194. Unintended `queue` constructor](https://cplusplus.github.io/LWG/issue1194) + - C++11で、アロケータを受け取るコンストラクタ群が、[`uses_allocator`](/reference/memory/uses_allocator.md)`::value`が`true`である場合にのみオーバーロード解決に参加するよう制約された。制約がないと、`Alloc`にコンテナが構築可能な任意の型を渡せてしまい、`queue q(5);`のような意図しない構築が通ってしまうため +- [LWG Issue 1199. Missing extended copy constructor in container adaptors](https://cplusplus.github.io/LWG/issue1199) + - C++11で、アロケータを指定する拡張コピーコンストラクタが追加された。ムーブ版は既に用意されていたが、コピー版が漏れていた diff --git a/reference/queue/queue/swap.md b/reference/queue/queue/swap.md index 5c8db742ab..e696ba3872 100644 --- a/reference/queue/queue/swap.md +++ b/reference/queue/queue/swap.md @@ -88,3 +88,5 @@ int main () ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 1198. Container adaptor `swap`: member or non-member?](https://cplusplus.github.io/LWG/issue1198) + - C++11で、メンバ`swap()`の効果が、基となるコンテナのメンバ`swap()`の呼び出しから、非修飾の`swap()`呼び出し (ADLによる探索を含む) へ改められた From 35732b889778ab579a8e362bb35578bb6b31e782 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:00:15 +0900 Subject: [PATCH 057/147] =?UTF-8?q?adjacent=5Fdifference=20:=20=E8=A8=88?= =?UTF-8?q?=E7=AE=97=E9=87=8F=E3=81=AE=E7=B7=A8=E9=9B=86=E4=B8=8A=E3=81=AE?= =?UTF-8?q?=E8=AA=A4=E3=82=8A=E8=A8=82=E6=AD=A3=E3=81=8CC++11=E3=81=A7?= =?UTF-8?q?=E5=85=A5=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/numeric/adjacent_difference.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/numeric/adjacent_difference.md b/reference/numeric/adjacent_difference.md index d3a9bcad96..43c290e7e2 100644 --- a/reference/numeric/adjacent_difference.md +++ b/reference/numeric/adjacent_difference.md @@ -101,7 +101,7 @@ result + (last - first) ## 計算量 -ちょうど`(last - first) - 1`回の2項演算を適用する +ちょうど`max((last - first) - 1, 0)`回の2項演算を適用する ## 備考 @@ -202,5 +202,7 @@ OutputIterator adjacent_difference(InputIterator first, InputIterator last, Outp - [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) - C++20で、並列バージョン以外の数値計算アルゴリズムが`constexpr`対応した +- [LWG Issue 539. `partial_sum` and `adjacent_difference` should mention requirements](https://cplusplus.github.io/LWG/issue539) + - C++11で、アキュムレータを用いた効果の規定へ整理され、要件が明記された。あわせて計算量が`max((last - first) - 1, 0)`となり、空の範囲に対して負の回数とならないよう修正された(編集上の誤りの訂正であり、実際の挙動は変わらない) - [LWG Issue 3058. Parallel `adjacent_difference` shouldn't require creating temporaries](https://cplusplus.github.io/LWG/issue3058) - C++20で、並列版(3), (4)の効果から中間一時オブジェクトの生成要求が取り除かれ、要件も結果が`result`に書き込み可能であることへ整理された From bd1e2f3140d300ffe9f55f5395e259d952655b0d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:00:43 +0900 Subject: [PATCH 058/147] =?UTF-8?q?iota=20:=20=E8=A6=81=E4=BB=B6=E3=81=AE?= =?UTF-8?q?=E6=9B=B8=E3=81=8D=E9=96=93=E9=81=95=E3=81=84=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/numeric/iota.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/numeric/iota.md b/reference/numeric/iota.md index 6fbc8984d5..9363761b32 100644 --- a/reference/numeric/iota.md +++ b/reference/numeric/iota.md @@ -24,7 +24,7 @@ namespace std { ## 要件 -- `ForwardIterator`の値型が、型`T`に変換可能であること +- 型`T`が、`ForwardIterator`の値型に代入可能であること - 型`T`の値`val`に対して、式`++val`が有効であること @@ -111,3 +111,5 @@ void iota(ForwardIterator first, ForwardIterator last, T value) - [N2666 More STL algorithms (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2666.pdf) - [P1645R1 `constexpr` for `` algorithms](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1645r1.html) - C++20で、並列バージョン以外の数値計算アルゴリズムが`constexpr`対応した +- [LWG Issue 871. Iota's requirements on `T` are too strong](https://cplusplus.github.io/LWG/issue871) + - C++11で、型`T`に対する`CopyConstructible`と`Assignable`の要件が削除され、`ForwardIterator`の値型へ代入可能であることのみが要求されるようになった From 33a137d82be05a8729e540433d003901ca9808f2 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:01:02 +0900 Subject: [PATCH 059/147] =?UTF-8?q?partial=5Fsum=20:=20=E8=A8=88=E7=AE=97?= =?UTF-8?q?=E9=87=8F=E3=81=AE=E7=B7=A8=E9=9B=86=E4=B8=8A=E3=81=AE=E8=AA=A4?= =?UTF-8?q?=E3=82=8A=E8=A8=82=E6=AD=A3=E3=81=8CC++11=E3=81=A7=E5=85=A5?= =?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/numeric/partial_sum.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/numeric/partial_sum.md b/reference/numeric/partial_sum.md index 7e9a2baa2d..9cac7c551b 100644 --- a/reference/numeric/partial_sum.md +++ b/reference/numeric/partial_sum.md @@ -102,7 +102,7 @@ namespace std { ## 計算量 -ちょうど`(last - first) - 1`回だけ`binary_op`を適用する +ちょうど`max((last - first) - 1, 0)`回だけ2項演算を適用する ## 備考 @@ -163,3 +163,5 @@ int main() - [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) - C++20で、並列バージョン以外の数値計算アルゴリズムが`constexpr`対応した +- [LWG Issue 539. `partial_sum` and `adjacent_difference` should mention requirements](https://cplusplus.github.io/LWG/issue539) + - C++11で、アキュムレータを用いた効果の規定へ整理され、要件が明記された。あわせて計算量が`max((last - first) - 1, 0)`となり、空の範囲に対して負の回数とならないよう修正された(編集上の誤りの訂正であり、実際の挙動は変わらない) From c9960a42310575a03e8c4ae744882cc471f7db1b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:03:04 +0900 Subject: [PATCH 060/147] =?UTF-8?q?basic=5Ffilebuf::open=20:=20C++11?= =?UTF-8?q?=E3=81=8B=E3=82=89=E5=85=A5=E3=81=A3=E3=81=9F=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=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=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/fstream/basic_filebuf/open.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/fstream/basic_filebuf/open.md b/reference/fstream/basic_filebuf/open.md index 56c582e9b6..b83586866e 100644 --- a/reference/fstream/basic_filebuf/open.md +++ b/reference/fstream/basic_filebuf/open.md @@ -5,10 +5,10 @@ * function[meta id-type] ```cpp -basic_filebuf* open(const char* s, ios_base::openmode mode); // (1) +basic_filebuf* open(const char* s, ios_base::openmode mode); // (1) C++98 basic_filebuf* open(const filesystem::path::value_type* s, ios_base::openmode mode); // (2) C++17 -basic_filebuf* open(const string& s, ios_base::openmode mode); // (3) +basic_filebuf* open(const string& s, ios_base::openmode mode); // (3) C++11 basic_filebuf* open(const filesystem::path& s, ios_base::openmode mode); // (4) C++17 template basic_filebuf* open(const T& s, ios_base::openmode mode); // (4) C++23 From 004b3b3ab64ebdadc7df507de5fb8885d6a3c8cc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:03:54 +0900 Subject: [PATCH 061/147] =?UTF-8?q?basic=5F[i=20|=20o]fstream=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=A8open=20:=20C++11=E3=81=8B=E3=82=89=E5=85=A5=E3=81=A3?= =?UTF-8?q?=E3=81=9F=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=81=AB=E8=A8=80=E8=AA=9E=E3=83=90=E3=83=BC=E3=82=B8?= =?UTF-8?q?=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 --- reference/fstream/basic_fstream/op_constructor.md | 6 +++--- reference/fstream/basic_fstream/open.md | 4 ++-- reference/fstream/basic_ifstream/op_constructor.md | 6 +++--- reference/fstream/basic_ifstream/open.md | 4 ++-- reference/fstream/basic_ofstream/op_constructor.md | 6 +++--- reference/fstream/basic_ofstream/open.md | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/reference/fstream/basic_fstream/op_constructor.md b/reference/fstream/basic_fstream/op_constructor.md index a095a31c48..727f40a0a6 100644 --- a/reference/fstream/basic_fstream/op_constructor.md +++ b/reference/fstream/basic_fstream/op_constructor.md @@ -5,9 +5,9 @@ * function[meta id-type] ```cpp -basic_fstream(); // (1) -explicit basic_fstream(const char* s, ios_base::openmode mode = ios_base::in | ios_base::out); // (2) -explicit basic_fstream(const string& s, ios_base::openmode mode = ios_base::in | ios_base::out); // (3) +basic_fstream(); // (1) C++98 +explicit basic_fstream(const char* s, ios_base::openmode mode = ios_base::in | ios_base::out); // (2) C++98 +explicit basic_fstream(const string& s, ios_base::openmode mode = ios_base::in | ios_base::out); // (3) C++11 explicit basic_fstream(const filesystem::path::value_type* s, ios_base::openmode mode = ios_base::in|ios_base::out); // (4) C++17 explicit basic_fstream(const filesystem::path& s, diff --git a/reference/fstream/basic_fstream/open.md b/reference/fstream/basic_fstream/open.md index 8fee67b41b..c52f8bdc89 100644 --- a/reference/fstream/basic_fstream/open.md +++ b/reference/fstream/basic_fstream/open.md @@ -7,13 +7,13 @@ ```cpp void open( const char* s, - ios_base::openmode mode = ios_base::in | ios_base::out); // (1) + ios_base::openmode mode = ios_base::in | ios_base::out); // (1) C++98 void open( const filesystem::path::value_type* s, ios_base::openmode mode = ios_base::in | ios_base::out); // (2) C++17 void open( const string& s, - ios_base::openmode mode = ios_base::in | ios_base::out); // (3) + ios_base::openmode mode = ios_base::in | ios_base::out); // (3) C++11 void open( const filesystem::path& s, ios_base::openmode mode = ios_base::in | ios_base::out); // (4) C++17 diff --git a/reference/fstream/basic_ifstream/op_constructor.md b/reference/fstream/basic_ifstream/op_constructor.md index a6c52ff9db..94d0f4f0ee 100644 --- a/reference/fstream/basic_ifstream/op_constructor.md +++ b/reference/fstream/basic_ifstream/op_constructor.md @@ -5,9 +5,9 @@ * function[meta id-type] ```cpp -basic_ifstream(); // (1) -explicit basic_ifstream(const char* s, ios_base::openmode mode = ios_base::in); // (2) -explicit basic_ifstream(const string& s, ios_base::openmode mode = ios_base::in); // (3) +basic_ifstream(); // (1) C++98 +explicit basic_ifstream(const char* s, ios_base::openmode mode = ios_base::in); // (2) C++98 +explicit basic_ifstream(const string& s, ios_base::openmode mode = ios_base::in); // (3) C++11 explicit basic_ifstream(const filesystem::path::value_type* s, ios_base::openmode mode = ios_base::in); // (4) C++17 explicit basic_ifstream(const filesystem::path& s, diff --git a/reference/fstream/basic_ifstream/open.md b/reference/fstream/basic_ifstream/open.md index b49885d806..31ee4c3f96 100644 --- a/reference/fstream/basic_ifstream/open.md +++ b/reference/fstream/basic_ifstream/open.md @@ -7,13 +7,13 @@ ```cpp void open( const char* s, - ios_base::openmode mode = ios_base::in); // (1) + ios_base::openmode mode = ios_base::in); // (1) C++98 void open( const filesystem::path::value_type* s, ios_base::openmode mode = ios_base::in); // (2) C++17 void open( const string& s, - ios_base::openmode mode = ios_base::in); // (3) + ios_base::openmode mode = ios_base::in); // (3) C++11 void open( const filesystem::path& s, ios_base::openmode mode = ios_base::in); // (4) C++17 diff --git a/reference/fstream/basic_ofstream/op_constructor.md b/reference/fstream/basic_ofstream/op_constructor.md index 893a376416..bdf7d9c7c3 100644 --- a/reference/fstream/basic_ofstream/op_constructor.md +++ b/reference/fstream/basic_ofstream/op_constructor.md @@ -5,9 +5,9 @@ * function[meta id-type] ```cpp -basic_ofstream(); // (1) -explicit basic_ofstream(const char* s, ios_base::openmode mode = ios_base::out); // (2) -explicit basic_ofstream(const string& s, ios_base::openmode mode = ios_base::out); // (3) +basic_ofstream(); // (1) C++98 +explicit basic_ofstream(const char* s, ios_base::openmode mode = ios_base::out); // (2) C++98 +explicit basic_ofstream(const string& s, ios_base::openmode mode = ios_base::out); // (3) C++11 explicit basic_ofstream(const filesystem::path::value_type* s, ios_base::openmode mode = ios_base::out); // (4) C++17 explicit basic_ofstream(const filesystem::path& s, diff --git a/reference/fstream/basic_ofstream/open.md b/reference/fstream/basic_ofstream/open.md index 1840920ffe..8b24d982e6 100644 --- a/reference/fstream/basic_ofstream/open.md +++ b/reference/fstream/basic_ofstream/open.md @@ -7,13 +7,13 @@ ```cpp void open( const char* s, - ios_base::openmode mode = ios_base::out); // (1) + ios_base::openmode mode = ios_base::out); // (1) C++98 void open( const filesystem::path::value_type* s, ios_base::openmode mode = ios_base::out); // (2) C++17 void open( const string& s, - ios_base::openmode mode = ios_base::out); // (3) + ios_base::openmode mode = ios_base::out); // (3) C++11 void open( const filesystem::path& s, ios_base::openmode mode = ios_base::out); // (4) C++17 From 875934997c4a85d81eafd708e8dc231e276467dc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:04:22 +0900 Subject: [PATCH 062/147] =?UTF-8?q?iomanip=20:=20C++11=E3=81=8B=E3=82=89?= =?UTF-8?q?=E5=85=A5=E3=81=A3=E3=81=9F=E6=A9=9F=E8=83=BD=E3=81=AE=E5=80=8B?= =?UTF-8?q?=E5=88=A5=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iomanip.md | 6 +- reference/iomanip/get_money.md | 110 ++++++++++++++++++++++++++++++ reference/iomanip/get_time.md | 118 +++++++++++++++++++++++++++++++++ reference/iomanip/put_money.md | 106 +++++++++++++++++++++++++++++ reference/iomanip/put_time.md | 5 ++ 5 files changed, 342 insertions(+), 3 deletions(-) create mode 100644 reference/iomanip/get_money.md create mode 100644 reference/iomanip/get_time.md create mode 100644 reference/iomanip/put_money.md diff --git a/reference/iomanip.md b/reference/iomanip.md index 27137e3a65..a7abadd7d0 100644 --- a/reference/iomanip.md +++ b/reference/iomanip.md @@ -13,8 +13,8 @@ | [`setfill`](iomanip/setfill.md) | 埋める文字を設定する (function template) | | | [`setprecision`](iomanip/setprecision.md) | 浮動小数点数を出力する精度を設定する (function) | | | [`setw`](iomanip/setw.md) | 出力する幅を設定する (function) | | -| `get_money` | 金額書式から入力する (function template) | C++11 | -| `put_money` | 金額書式で出力する (function template) | C++11 | -| `get_time` | 日時書式から入力する (function template) | C++11 | +| [`get_money`](iomanip/get_money.md) | 金額書式から入力する (function template) | C++11 | +| [`put_money`](iomanip/put_money.md) | 金額書式で出力する (function template) | C++11 | +| [`get_time`](iomanip/get_time.md) | 日時書式から入力する (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/get_money.md b/reference/iomanip/get_money.md new file mode 100644 index 0000000000..36d597e93e --- /dev/null +++ b/reference/iomanip/get_money.md @@ -0,0 +1,110 @@ +# get_money +* iomanip[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp11[meta cpp] + +```cpp +namespace std { + template + unspecified get_money(moneyT& mon, bool intl = false); // (1) C++11 +} +``` +* unspecified[italic] + +## 概要 +金額書式から入力する。 + +`intl`に`true`を指定した場合は国際通貨表記 (`JPY`のような通貨記号) 、`false`を指定した場合は各国内での通貨表記 (`¥`のような通貨記号) として解析する。 + + +## 要件 +型`moneyT`は、`long double`もしくは[`basic_string`](/reference/string/basic_string.md)の特殊化のいずれかであること。 + + +## 戻り値 +未規定の型のオブジェクトを返す。`in`を[`basic_istream`](/reference/istream/basic_istream.md)``型のオブジェクトとして、式`in >> get_money(mon, intl)`は以下の関数`f`を`f(in, mon, intl)`と呼び出したかのように振る舞う: + +```cpp +template +void f(basic_ios& str, moneyT& mon, bool intl) +{ + using Iter = istreambuf_iterator; + using MoneyGet = money_get; + + ios_base::iostate err = ios_base::goodbit; + const MoneyGet& mg = use_facet(str.getloc()); + + mg.get(Iter(str.rdbuf()), Iter(), intl, str, err, mon); + + if (ios_base::goodbit != err) + str.setstate(err); +} +``` +* basic_ios[link /reference/ios/basic_ios.md] +* istreambuf_iterator[link /reference/iterator/istreambuf_iterator.md] +* money_get[link /reference/locale/money_get.md] +* use_facet[link /reference/locale/use_facet.md] +* str.getloc()[link /reference/ios/ios_base/getloc.md] +* str.rdbuf()[link /reference/ios/basic_ios/rdbuf.md] +* mg.get[link /reference/locale/money_get/get.md] +* ios_base[link /reference/ios/ios_base.md] +* goodbit[link /reference/ios/ios_base/type-iostate.md] +* str.setstate[link /reference/ios/basic_ios/setstate.md] + +式`in >> get_money(mon, intl)`は、[`basic_istream`](/reference/istream/basic_istream.md)`&`型を持ち、その値は`in`である。 + + +## 備考 +解析される金額は、通貨の最小単位 (日本円なら円、米ドルならセント) を単位とする値である。小数点の位置や通貨記号の有無は、ストリームに設定されているロケールの[`moneypunct`](/reference/locale/moneypunct.md)ファセットによって決まる。 + +この関数は書式化入力関数として振る舞う。 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + // Cロケールでは通貨記号がなく、小数点以下の桁数は0となる + std::istringstream ss("123456 987"); + + // long doubleで受け取る + long double value = 0; + ss >> std::get_money(value); + std::cout << value << std::endl; + + // 文字列で受け取る + std::string digits; + ss >> std::get_money(digits); + std::cout << digits << std::endl; +} +``` +* std::get_money[color ff0000] + +### 出力 +``` +123456 +987 +``` + + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [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): ?? + + +## 関連項目 +- [`put_money`](put_money.md) +- [`money_get`](/reference/locale/money_get.md) +- [`moneypunct`](/reference/locale/moneypunct.md) diff --git a/reference/iomanip/get_time.md b/reference/iomanip/get_time.md new file mode 100644 index 0000000000..4fd402639e --- /dev/null +++ b/reference/iomanip/get_time.md @@ -0,0 +1,118 @@ +# get_time +* iomanip[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp11[meta cpp] + +```cpp +namespace std { + template + unspecified get_time(struct tm* tmb, const CharT* fmt); // (1) C++11 +} +``` +* unspecified[italic] + +## 概要 +日時書式から入力する。 + + +## 要件 +- `tmb`は、有効な`tm`型オブジェクトを指すポインタであること。 +- `fmt`は、[`char_traits`](/reference/string/char_traits.md)`::`[`length`](/reference/string/char_traits/length.md)`(fmt)`個の要素を持つ、有効な`CharT`型の配列を指すポインタであること。 + + +## 戻り値 +未規定の型のオブジェクトを返す。`in`を[`basic_istream`](/reference/istream/basic_istream.md)``型のオブジェクトとして、式`in >> get_time(tmb, fmt)`は以下の関数`f`を`f(in, tmb, fmt)`と呼び出したかのように振る舞う: + +```cpp +template +void f(basic_ios& str, struct tm* tmb, const CharT* fmt) +{ + using Iter = istreambuf_iterator; + using TimeGet = time_get; + + ios_base::iostate err = ios_base::goodbit; + const TimeGet& tg = use_facet(str.getloc()); + + tg.get(Iter(str.rdbuf()), Iter(), str, err, tmb, + fmt, fmt + Traits::length(fmt)); + + if (err != ios_base::goodbit) + str.setstate(err); +} +``` +* basic_ios[link /reference/ios/basic_ios.md] +* istreambuf_iterator[link /reference/iterator/istreambuf_iterator.md] +* time_get[link /reference/locale/time_get.md] +* use_facet[link /reference/locale/use_facet.md] +* str.getloc()[link /reference/ios/ios_base/getloc.md] +* str.rdbuf()[link /reference/ios/basic_ios/rdbuf.md] +* tg.get[link /reference/locale/time_get/get.md] +* ios_base[link /reference/ios/ios_base.md] +* goodbit[link /reference/ios/ios_base/type-iostate.md] +* str.setstate[link /reference/ios/basic_ios/setstate.md] + +式`in >> get_time(tmb, fmt)`は、[`basic_istream`](/reference/istream/basic_istream.md)`&`型を持ち、その値は`in`である。 + + +## 備考 +`fmt`に指定する書式は[`std::strftime()`](/reference/ctime/strftime.md)と同じものであり、どの書式指定子が扱えるかはストリームに設定されているロケールの[`time_get`](/reference/locale/time_get.md)ファセットに依存する。 + +`tmb`が指すオブジェクトのうち、書式に現れなかったメンバは変更されない。そのため、あらかじめ値初期化しておくとよい。 + +この関数は書式化入力関数として振る舞う。 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::istringstream ss("2014-12-25 15:12:30"); + + std::tm t{}; + ss >> std::get_time(&t, "%Y-%m-%d %H:%M:%S"); + + if (ss.fail()) { + std::cout << "parse error" << std::endl; + } + else { + std::cout << t.tm_year + 1900 << '/' << t.tm_mon + 1 << '/' << t.tm_mday << std::endl; + std::cout << t.tm_hour << ':' << t.tm_min << ':' << t.tm_sec << std::endl; + } +} +``` +* std::get_time[color ff0000] +* std::tm[link /reference/ctime/tm.md] +* ss.fail()[link /reference/ios/basic_ios/fail.md] + +### 出力 +``` +2014/12/25 +15:12:30 +``` + + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [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): ?? + + +## 関連項目 +- [`put_time`](put_time.md) +- [`time_get`](/reference/locale/time_get.md) + + +## 参照 +- [LWG Issue 1299. Confusing typo in specification for `get_time`](https://cplusplus.github.io/LWG/issue1299) + - C++11で、効果を示す説明用コード内の`tm.get(...)`という誤記が`tg.get(...)`へ修正された diff --git a/reference/iomanip/put_money.md b/reference/iomanip/put_money.md new file mode 100644 index 0000000000..cb9462299f --- /dev/null +++ b/reference/iomanip/put_money.md @@ -0,0 +1,106 @@ +# put_money +* iomanip[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp11[meta cpp] + +```cpp +namespace std { + template + unspecified put_money(const moneyT& mon, bool intl = false); // (1) C++11 +} +``` +* unspecified[italic] + +## 概要 +金額書式で出力する。 + +`intl`に`true`を指定した場合は国際通貨表記 (`JPY`のような通貨記号) 、`false`を指定した場合は各国内での通貨表記 (`¥`のような通貨記号) として出力する。 + + +## 要件 +型`moneyT`は、`long double`もしくは[`basic_string`](/reference/string/basic_string.md)の特殊化のいずれかであること。 + + +## 戻り値 +未規定の型のオブジェクトを返す。`out`を[`basic_ostream`](/reference/ostream/basic_ostream.md)``型のオブジェクトとして、式`out << put_money(mon, intl)`は以下の関数`f`を`f(out, mon, intl)`と呼び出したかのように振る舞う: + +```cpp +template +void f(basic_ios& str, const moneyT& mon, bool intl) +{ + using Iter = ostreambuf_iterator; + using MoneyPut = money_put; + + const MoneyPut& mp = use_facet(str.getloc()); + const Iter end = mp.put(Iter(str.rdbuf()), intl, str, str.fill(), mon); + + if (end.failed()) + str.setstate(ios_base::badbit); +} +``` +* basic_ios[link /reference/ios/basic_ios.md] +* ostreambuf_iterator[link /reference/iterator/ostreambuf_iterator.md] +* money_put[link /reference/locale/money_put.md] +* use_facet[link /reference/locale/use_facet.md] +* str.getloc()[link /reference/ios/ios_base/getloc.md] +* str.rdbuf()[link /reference/ios/basic_ios/rdbuf.md] +* str.fill()[link /reference/ios/basic_ios/fill.md] +* mp.put[link /reference/locale/money_put/put.md] +* end.failed()[link /reference/iterator/ostreambuf_iterator/failed.md] +* ios_base[link /reference/ios/ios_base.md] +* badbit[link /reference/ios/ios_base/type-iostate.md] +* str.setstate[link /reference/ios/basic_ios/setstate.md] + +式`out << put_money(mon, intl)`は、[`basic_ostream`](/reference/ostream/basic_ostream.md)`&`型を持ち、その値は`out`である。 + + +## 備考 +出力する金額は、通貨の最小単位 (日本円なら円、米ドルならセント) を単位とする値として渡す。小数点の位置や通貨記号の有無は、ストリームに設定されているロケールの[`moneypunct`](/reference/locale/moneypunct.md)ファセットによって決まる。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // Cロケールでは通貨記号がなく、小数点以下の桁数は0となる + + // long doubleで指定する + std::cout << std::put_money(123456.0L) << std::endl; + + // 文字列で指定する + std::cout << std::put_money(std::string("987")) << std::endl; + + // 国際通貨表記で出力する + std::cout << std::put_money(123456.0L, true) << std::endl; +} +``` +* std::put_money[color ff0000] + +### 出力 +``` +123456 +987 +123456 +``` + + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [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): ?? + + +## 関連項目 +- [`get_money`](get_money.md) +- [`money_put`](/reference/locale/money_put.md) +- [`moneypunct`](/reference/locale/moneypunct.md) diff --git a/reference/iomanip/put_time.md b/reference/iomanip/put_time.md index c2ca9db526..9e98165799 100644 --- a/reference/iomanip/put_time.md +++ b/reference/iomanip/put_time.md @@ -93,3 +93,8 @@ 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): ?? + + +## 関連項目 +- [`get_time`](get_time.md) +- [`time_put`](/reference/locale/time_put.md) From 7e05c2f056f811e40155df62e32e61333206bec6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:05:05 +0900 Subject: [PATCH 063/147] =?UTF-8?q?basic=5Fistream::sentry=20:=20op=5Fbool?= =?UTF-8?q?=E3=81=AE=E5=80=8B=E5=88=A5=E3=83=9A=E3=83=BC=E3=82=B8=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/istream/basic_istream/sentry.md | 13 ++++++-- .../istream/basic_istream/sentry/op_bool.md | 30 +++++++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 reference/istream/basic_istream/sentry/op_bool.md diff --git a/reference/istream/basic_istream/sentry.md b/reference/istream/basic_istream/sentry.md index f2c430f84f..5580940eea 100644 --- a/reference/istream/basic_istream/sentry.md +++ b/reference/istream/basic_istream/sentry.md @@ -11,10 +11,16 @@ namespace std { public: explicit sentry(basic_istream& is, bool noskipws = false); ~sentry(); - explicit operator bool() const; - sentry(const sentry&) = delete; - sentry& operator=(const sentry&) = delete; + operator bool() const; // C++98 + explicit operator bool() const; // C++11 + + private: + sentry(const sentry&); // C++98 宣言のみ + sentry& operator=(const sentry&); // C++98 宣言のみ + public: + sentry(const sentry&) = delete; // C++11 + sentry& operator=(const sentry&) = delete; // C++11 }; } ``` @@ -36,6 +42,7 @@ namespace std { |-------------------------------------|----------------|----------------| | [`(constructor)`](sentry/op_constructor.md) | コンストラクタ | | | [`(destructor)`](sentry/op_destructor.md) | デストラクタ | | +| [`operator bool`](sentry/op_bool.md) | 前処理が正常に完了したかを判定する | | ## 参照 diff --git a/reference/istream/basic_istream/sentry/op_bool.md b/reference/istream/basic_istream/sentry/op_bool.md new file mode 100644 index 0000000000..a8b01db1fe --- /dev/null +++ b/reference/istream/basic_istream/sentry/op_bool.md @@ -0,0 +1,30 @@ +# operator bool +* istream[meta header] +* std[meta namespace] +* basic_istream::sentry[meta class] +* function[meta id-type] + +```cpp +operator bool() const; // (1) C++98 +explicit operator bool() const; // (1) C++11 +``` + +## 概要 +入力処理の前処理が正常に完了したか否かを返す。 + + +## 戻り値 +本オブジェクトの構築時に入力処理の前処理が正常に完了していれば`true`、そうでなければ`false`。 + + +## 備考 +C++11で`explicit`が付加された。これにより、`bool`への意図しない暗黙変換が行われなくなった。 + + +## バージョン +### 言語 +- C++98 + + +## 関連項目 +- [`(constructor)`](op_constructor.md) From 23ddd7d8cf3cfd76ceb5f616a2e518cc576a57f0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:07:07 +0900 Subject: [PATCH 064/147] =?UTF-8?q?istreambuf=5Fiterator=E3=81=AE=E7=AD=89?= =?UTF-8?q?=E5=80=A4=E6=AF=94=E8=BC=83=E3=81=A8=E9=9D=9E=E7=AD=89=E5=80=A4?= =?UTF-8?q?=E6=AF=94=E8=BC=83=20:=20=E3=82=AF=E3=83=A9=E3=82=B9=E5=90=8D?= =?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/iterator/istreambuf_iterator/op_equal.md | 2 +- reference/iterator/istreambuf_iterator/op_not_equal.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/iterator/istreambuf_iterator/op_equal.md b/reference/iterator/istreambuf_iterator/op_equal.md index 1e3d396a94..ea2cebea09 100644 --- a/reference/iterator/istreambuf_iterator/op_equal.md +++ b/reference/iterator/istreambuf_iterator/op_equal.md @@ -11,7 +11,7 @@ namespace std { template > - class istream_iterator { + class istreambuf_iterator { public: friend bool operator==(const istreambuf_iterator& i, default_sentinel_t); // (2) C++20 }; diff --git a/reference/iterator/istreambuf_iterator/op_not_equal.md b/reference/iterator/istreambuf_iterator/op_not_equal.md index 94453e3588..3732c96847 100644 --- a/reference/iterator/istreambuf_iterator/op_not_equal.md +++ b/reference/iterator/istreambuf_iterator/op_not_equal.md @@ -12,7 +12,7 @@ namespace std { template > - class istream_iterator { + class istreambuf_iterator { public: friend bool operator!=(const istreambuf_iterator& i, default_sentinel_t); // (2) C++20 friend bool operator!=(default_sentinel_t, const istreambuf_iterator& i); // (3) C++20 From 526341818caeebc35476bd2d0f715174490e1de9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:07:32 +0900 Subject: [PATCH 065/147] =?UTF-8?q?istreambuf=5Fiterator=E3=81=AE=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E3=83=AA=E3=83=A1=E3=83=B3=E3=83=88=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=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/istreambuf_iterator/op_increment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/iterator/istreambuf_iterator/op_increment.md b/reference/iterator/istreambuf_iterator/op_increment.md index c32dba6c2f..b76202e245 100644 --- a/reference/iterator/istreambuf_iterator/op_increment.md +++ b/reference/iterator/istreambuf_iterator/op_increment.md @@ -5,8 +5,8 @@ * function[meta id-type] ```cpp -istreambuf_iterator& operator++(); -proxy operator++(int); +istreambuf_iterator& operator++(); // (1) C++98 +proxy operator++(int); // (2) C++98 ``` * proxy[italic] From e2a21d7dda147b753770c36d62e7c34c2ac36521 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:08:05 +0900 Subject: [PATCH 066/147] =?UTF-8?q?istreambuf=5Fiterator::open=20:=20?= =?UTF-8?q?=E3=83=91=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF=E5=9E=8B=E3=81=8C?= =?UTF-8?q?C++11=E3=81=A7=E5=A4=89=E6=9B=B4=E3=81=AB=E3=81=AA=E3=81=A3?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/istreambuf_iterator/equal.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reference/iterator/istreambuf_iterator/equal.md b/reference/iterator/istreambuf_iterator/equal.md index eb27830dcb..efd87d51a4 100644 --- a/reference/iterator/istreambuf_iterator/equal.md +++ b/reference/iterator/istreambuf_iterator/equal.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -bool equal(const istreambuf_iterator& b) const; +bool equal(istreambuf_iterator& b) const; // (1) C++98 +bool equal(const istreambuf_iterator& b) const; // (1) C++11 ``` ## 概要 @@ -59,3 +60,5 @@ equal ``` ## 参照 +- [LWG Issue 1126. `istreambuff_iterator::equal` needs a const & parameter](https://cplusplus.github.io/LWG/issue1126) + - C++11で、引数の型が`istreambuf_iterator&`から`const istreambuf_iterator&`へ改められた。一時オブジェクトを渡せるようにするため From b7e3dceed91936b294d3cc1c20dcf6a321a19182 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:08:21 +0900 Subject: [PATCH 067/147] =?UTF-8?q?istreambuf=5Fiterator=E3=81=AE=E3=82=A2?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E6=BC=94=E7=AE=97=E5=AD=90=20:=20LWG=20Issue?= =?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/iterator/istreambuf_iterator/op_arrow.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/iterator/istreambuf_iterator/op_arrow.md b/reference/iterator/istreambuf_iterator/op_arrow.md index 042cae914a..39ad32e2f8 100644 --- a/reference/iterator/istreambuf_iterator/op_arrow.md +++ b/reference/iterator/istreambuf_iterator/op_arrow.md @@ -45,6 +45,8 @@ pointer operator->() const; ## 参照 +- [LWG Issue 659. `istreambuf_iterator` should have an `operator->()`](https://cplusplus.github.io/LWG/issue659) + - C++11で、入力イテレータの要件を満たすためにこの関数が追加された。ただし戻り値の型が未規定とされたため処理系ごとに挙動が分かれ、C++17で削除された - [LWG Issue 2790. Missing specification of `istreambuf_iterator::operator->`](https://cplusplus.github.io/LWG/issue2790) - C++17で、仕様が定まらないこのメンバ関数が削除された - このメンバ関数には効果の規定が存在せず、主要な処理系も提供していなかったため、削除による実際の影響はほとんどない From ef47316baca718ae000e7ab409463083935f09b3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:14:57 +0900 Subject: [PATCH 068/147] =?UTF-8?q?move=5Fiterator=E3=81=AE=E6=B7=BB?= =?UTF-8?q?=E5=AD=97=E6=BC=94=E7=AE=97=E5=AD=90=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=E7=95=AA=E5=8F=B7?= =?UTF-8?q?=E3=82=92=E3=81=A4=E3=81=91=E3=81=A6=E8=A8=80=E8=AA=9E=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=81=94=E3=81=A8=E3=81=AE?= =?UTF-8?q?=E4=BB=95=E6=A7=98=E6=9B=B8=E3=81=8D=E5=88=86=E3=81=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/move_iterator/op_at.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/reference/iterator/move_iterator/op_at.md b/reference/iterator/move_iterator/op_at.md index 961b87960e..1f234eee72 100644 --- a/reference/iterator/move_iterator/op_at.md +++ b/reference/iterator/move_iterator/op_at.md @@ -6,9 +6,9 @@ * cpp11[meta cpp] ```cpp -unspecified operator[](difference_type n) const; // C++11 -constexpr unspecified operator[](difference_type n) const; // C++17 -constexpr reference operator[](difference_type n) const; // C++20 +unspecified operator[](difference_type n) const; // (1) C++11 +constexpr unspecified operator[](difference_type n) const; // (1) C++17 +constexpr reference operator[](difference_type n) const; // (1) C++20 ``` * unspecified[italic] @@ -17,11 +17,16 @@ constexpr reference operator[](difference_type n) const; // C++20 ## 戻り値 +- (1) : + - C++11 : `return std::`[`move`](/reference/utility/move.md)`(`[`base`](base.md)`()[n]);` + - C++20 : `return ranges::`[`iter_move`](/reference/iterator/iter_move.md)`(`[`base`](base.md)`() + n);` -- C++17まで - - `return std::`[`move`](/reference/utility/move.md)`(`[`base`](base.md)`()[n]);` -- C++20 - - `return ranges::`[`iter_move`](/reference/iterator/iter_move.md)`(`[`base`](base.md)`() + n);` + +## 備考 +- (1) : + - C++11 : 戻り値の型は未規定である。[`base`](base.md)`()[n]`がプロキシオブジェクトを返す場合に、`reference` (`value_type&&`) へ暗黙変換すると、破棄済みの一時オブジェクトを参照しうるため + - C++17 : `constexpr`が付加された + - C++20 : 戻り値の型が`reference`となり、[`ranges::iter_move`](/reference/iterator/iter_move.md)を用いて規定されるようになった ## 例 @@ -66,3 +71,5 @@ int main() ## 参照 - [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) - [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 872. `move_iterator::operator[]` has wrong return type](https://cplusplus.github.io/LWG/issue872) + - C++11の策定時に、戻り値の型が`reference`から未規定の型へ改められた。[`base`](base.md)`()[n]`がプロキシオブジェクトを返す場合、`reference` (`value_type&&`) への暗黙変換によって破棄済みの一時オブジェクトを参照しうるため From 9ffc2defdbbbee9d8a50bac746f6b58a3ab4f885 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:15:34 +0900 Subject: [PATCH 069/147] =?UTF-8?q?istream=5Fiterator=E3=81=AE=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E3=83=AA=E3=83=A1=E3=83=B3=E3=83=88=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=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/iterator/istream_iterator/op_increment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/iterator/istream_iterator/op_increment.md b/reference/iterator/istream_iterator/op_increment.md index b482813bbb..d9a11c1048 100644 --- a/reference/iterator/istream_iterator/op_increment.md +++ b/reference/iterator/istream_iterator/op_increment.md @@ -5,8 +5,8 @@ * function[meta id-type] ```cpp -istream_iterator& operator++(); -istream_iterator operator++(int); +istream_iterator& operator++(); // (1) C++98 +istream_iterator operator++(int); // (2) C++98 ``` ## 概要 From 07a53c89de0e399624d71a5273e5762b18fe8bac Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:16:45 +0900 Subject: [PATCH 070/147] =?UTF-8?q?move=5Fiterator=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=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/iterator/move_iterator/op_arrow.md | 4 ++-- reference/iterator/move_iterator/op_decrement.md | 8 ++++---- reference/iterator/move_iterator/op_deref.md | 4 ++-- reference/iterator/move_iterator/op_greater.md | 4 ++-- reference/iterator/move_iterator/op_greater_equal.md | 4 ++-- reference/iterator/move_iterator/op_less.md | 4 ++-- reference/iterator/move_iterator/op_less_equal.md | 4 ++-- reference/iterator/move_iterator/op_minus_assign.md | 4 ++-- reference/iterator/move_iterator/op_plus.md | 6 +++--- reference/iterator/move_iterator/op_plus_assign.md | 4 ++-- reference/iterator/move_iterator/op_unary_minus.md | 4 ++-- reference/iterator/move_iterator/op_unary_plus.md | 4 ++-- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/reference/iterator/move_iterator/op_arrow.md b/reference/iterator/move_iterator/op_arrow.md index eac4ea2515..8355b957dd 100644 --- a/reference/iterator/move_iterator/op_arrow.md +++ b/reference/iterator/move_iterator/op_arrow.md @@ -6,8 +6,8 @@ * cpp11[meta cpp] ```cpp -pointer operator->() const; // C++11 -constexpr pointer operator->() const; // C++17 +pointer operator->() const; // (1) C++11 +constexpr pointer operator->() const; // (1) C++17 ``` ## 概要 diff --git a/reference/iterator/move_iterator/op_decrement.md b/reference/iterator/move_iterator/op_decrement.md index 66a7337838..b1265025a4 100644 --- a/reference/iterator/move_iterator/op_decrement.md +++ b/reference/iterator/move_iterator/op_decrement.md @@ -6,11 +6,11 @@ * cpp11[meta cpp] ```cpp -move_iterator& operator--(); // C++11 -constexpr move_iterator& operator--(); // C++17 +move_iterator& operator--(); // (1) C++11 +constexpr move_iterator& operator--(); // (1) C++17 -move_iterator operator--(int); // C++11 -constexpr move_iterator operator--(int); // C++17 +move_iterator operator--(int); // (2) C++11 +constexpr move_iterator operator--(int); // (2) C++17 ``` ## 概要 diff --git a/reference/iterator/move_iterator/op_deref.md b/reference/iterator/move_iterator/op_deref.md index a7946cdf74..56ba9ca917 100644 --- a/reference/iterator/move_iterator/op_deref.md +++ b/reference/iterator/move_iterator/op_deref.md @@ -6,8 +6,8 @@ * cpp11[meta cpp] ```cpp -reference operator*() const; // C++11 -constexpr reference operator*() const; // C++17 +reference operator*() const; // (1) C++11 +constexpr reference operator*() const; // (1) C++17 ``` ## 概要 diff --git a/reference/iterator/move_iterator/op_greater.md b/reference/iterator/move_iterator/op_greater.md index 6ce11e8784..d40ff710e4 100644 --- a/reference/iterator/move_iterator/op_greater.md +++ b/reference/iterator/move_iterator/op_greater.md @@ -8,11 +8,11 @@ namespace std { template bool operator>(const move_iterator& x, - const move_iterator& y); // C++11 + const move_iterator& y); // (1) C++11 template constexpr bool operator>(const move_iterator& x, - const move_iterator& y); // C++17 + const move_iterator& y); // (1) C++17 } ``` diff --git a/reference/iterator/move_iterator/op_greater_equal.md b/reference/iterator/move_iterator/op_greater_equal.md index e87fe0d713..ca334b1d82 100644 --- a/reference/iterator/move_iterator/op_greater_equal.md +++ b/reference/iterator/move_iterator/op_greater_equal.md @@ -8,11 +8,11 @@ namespace std { template bool operator>=(const move_iterator& x, - const move_iterator& y); // C++11 + const move_iterator& y); // (1) C++11 template constexpr bool operator>=(const move_iterator& x, - const move_iterator& y); // C++17 + const move_iterator& y); // (1) C++17 } ``` diff --git a/reference/iterator/move_iterator/op_less.md b/reference/iterator/move_iterator/op_less.md index 4541aaa58d..706e2c3719 100644 --- a/reference/iterator/move_iterator/op_less.md +++ b/reference/iterator/move_iterator/op_less.md @@ -8,11 +8,11 @@ namespace std { template bool operator<(const move_iterator& x, - const move_iterator& y); // C++11 + const move_iterator& y); // (1) C++11 template constexpr bool operator<(const move_iterator& x, - const move_iterator& y); // C++17 + const move_iterator& y); // (1) C++17 } ``` diff --git a/reference/iterator/move_iterator/op_less_equal.md b/reference/iterator/move_iterator/op_less_equal.md index 77d43398f6..425e09e2d4 100644 --- a/reference/iterator/move_iterator/op_less_equal.md +++ b/reference/iterator/move_iterator/op_less_equal.md @@ -8,11 +8,11 @@ namespace std { template bool operator<=(const move_iterator& x, - const move_iterator& y); // C++11 + const move_iterator& y); // (1) C++11 template constexpr bool operator<=(const move_iterator& x, - const move_iterator& y); // C++17 + const move_iterator& y); // (1) C++17 } ``` diff --git a/reference/iterator/move_iterator/op_minus_assign.md b/reference/iterator/move_iterator/op_minus_assign.md index 1439d689b3..537d479e7b 100644 --- a/reference/iterator/move_iterator/op_minus_assign.md +++ b/reference/iterator/move_iterator/op_minus_assign.md @@ -6,8 +6,8 @@ * cpp11[meta cpp] ```cpp -move_iterator& operator-=(difference_type n); // C++11 -constexpr move_iterator& operator-=(difference_type n); // C++17 +move_iterator& operator-=(difference_type n); // (1) C++11 +constexpr move_iterator& operator-=(difference_type n); // (1) C++17 ``` ## 概要 diff --git a/reference/iterator/move_iterator/op_plus.md b/reference/iterator/move_iterator/op_plus.md index e2cbae1ca5..03e965e13d 100644 --- a/reference/iterator/move_iterator/op_plus.md +++ b/reference/iterator/move_iterator/op_plus.md @@ -9,17 +9,17 @@ namespace std { template move_iterator operator+( typename move_iterator::difference_type n, - const move_iterator& x); // C++11 + const move_iterator& x); // (1) C++11 template constexpr move_iterator operator+( typename move_iterator::difference_type n, - const move_iterator& x); // C++17 + const move_iterator& x); // (1) C++17 template constexpr move_iterator operator+( iter_difference_t n, - const move_iterator& x); // C++20 + const move_iterator& x); // (1) C++20 } ``` diff --git a/reference/iterator/move_iterator/op_plus_assign.md b/reference/iterator/move_iterator/op_plus_assign.md index f45ec1451b..ea3071d253 100644 --- a/reference/iterator/move_iterator/op_plus_assign.md +++ b/reference/iterator/move_iterator/op_plus_assign.md @@ -6,8 +6,8 @@ * cpp11[meta cpp] ```cpp -move_iterator& operator+=(difference_type n); // C++11 -constexpr move_iterator& operator+=(difference_type n); // C++17 +move_iterator& operator+=(difference_type n); // (1) C++11 +constexpr move_iterator& operator+=(difference_type n); // (1) C++17 ``` ## 概要 diff --git a/reference/iterator/move_iterator/op_unary_minus.md b/reference/iterator/move_iterator/op_unary_minus.md index 34e4690dd6..19b77b3410 100644 --- a/reference/iterator/move_iterator/op_unary_minus.md +++ b/reference/iterator/move_iterator/op_unary_minus.md @@ -6,8 +6,8 @@ * cpp11[meta cpp] ```cpp -move_iterator operator-(difference_type n) const; // C++11 -constexpr move_iterator operator-(difference_type n) const; // C++17 +move_iterator operator-(difference_type n) const; // (1) C++11 +constexpr move_iterator operator-(difference_type n) const; // (1) C++17 ``` ## 概要 diff --git a/reference/iterator/move_iterator/op_unary_plus.md b/reference/iterator/move_iterator/op_unary_plus.md index ea853c30ce..9d5441bd42 100644 --- a/reference/iterator/move_iterator/op_unary_plus.md +++ b/reference/iterator/move_iterator/op_unary_plus.md @@ -6,8 +6,8 @@ * cpp11[meta cpp] ```cpp -move_iterator operator+(difference_type n) const; // C++11 -constexpr move_iterator operator+(difference_type n) const; // C++17 +move_iterator operator+(difference_type n) const; // (1) C++11 +constexpr move_iterator operator+(difference_type n) const; // (1) C++17 ``` ## 概要 From 07eec854a2bdbe6dc186f4da1d0fc48f6569d8d3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:17:24 +0900 Subject: [PATCH 071/147] =?UTF-8?q?move=5Fiterator=E3=81=AE=E3=83=87?= =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=AB=E3=83=88=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=E5=80=A4=E5=88=9D?= =?UTF-8?q?=E6=9C=9F=E5=8C=96=E3=81=95=E3=82=8C=E3=82=8B=E3=81=93=E3=81=A8?= =?UTF-8?q?=E3=81=8C=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/iterator/move_iterator/op_constructor.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/iterator/move_iterator/op_constructor.md b/reference/iterator/move_iterator/op_constructor.md index 465468b501..312ba98ff6 100644 --- a/reference/iterator/move_iterator/op_constructor.md +++ b/reference/iterator/move_iterator/op_constructor.md @@ -24,7 +24,7 @@ constexpr move_iterator(move_iterator&&) noexcept = default; // (4) C++17 ## 概要 `move_iterator`オブジェクトを構築する。 -- (1) : デフォルトコンストラクタ。内包する元となるイテレータを値初期化する。 +- (1) : デフォルトコンストラクタ。内包する元となるイテレータを値初期化する。このイテレータに対する操作は、値初期化された`Iterator`型のイテレータに対して対応する操作が定義されている場合にのみ、定義された動作をする。 - (2) : 元となるイテレータ`i`をメンバ変数にムーブして保持する。 - (3) : `u.base()`をメンバ変数に保持する。 @@ -88,4 +88,6 @@ int main() ## 参照 - [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) +- [LWG Issue 1012. `reverse_iterator` default ctor should value initialize](https://cplusplus.github.io/LWG/issue1012) + - C++11で、デフォルトコンストラクタの効果が、内包するイテレータのデフォルト初期化から値初期化へ改められた - [LWG Issue 3435. `three_way_comparable_with, reverse_iterator>`](https://cplusplus.github.io/LWG/issue3435) From 4a7a3fe9afa0fac2887def58d5a71efec0c7c521 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:18:06 +0900 Subject: [PATCH 072/147] =?UTF-8?q?ostream=5Fiterator=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?=E4=B8=8D=E8=A6=81=E3=81=AA=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=83=91=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=81=AE=E8=A8=98=E8=BC=89=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/ostream_iterator/op_constructor.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/iterator/ostream_iterator/op_constructor.md b/reference/iterator/ostream_iterator/op_constructor.md index 970aa62c94..d040431b13 100644 --- a/reference/iterator/ostream_iterator/op_constructor.md +++ b/reference/iterator/ostream_iterator/op_constructor.md @@ -5,9 +5,9 @@ * function[meta id-type] ```cpp -ostream_iterator(ostream_type& s); // (1) -ostream_iterator(ostream_type& s, const CharT* delimiter); // (2) -ostream_iterator(const ostream_iterator& x) = default; // (3) +ostream_iterator(ostream_type& s); // (1) C++98 +ostream_iterator(ostream_type& s, const CharT* delimiter); // (2) C++98 +ostream_iterator(const ostream_iterator& x); // (3) C++98 ``` ## 概要 From 7674c24db574ec2b7b2323cfa25cefa1e520c416 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:18:31 +0900 Subject: [PATCH 073/147] =?UTF-8?q?ostream=5Fiterator=E3=81=AE=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E3=83=AA=E3=83=A1=E3=83=B3=E3=83=88=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=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/iterator/ostream_iterator/op_increment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/iterator/ostream_iterator/op_increment.md b/reference/iterator/ostream_iterator/op_increment.md index a9e90c1b9f..0f8327ee11 100644 --- a/reference/iterator/ostream_iterator/op_increment.md +++ b/reference/iterator/ostream_iterator/op_increment.md @@ -5,8 +5,8 @@ * function[meta id-type] ```cpp -ostream_iterator& operator++(); -ostream_iterator& operator++(int); +ostream_iterator& operator++(); // (1) C++98 +ostream_iterator& operator++(int); // (2) C++98 ``` ## 概要 From 0cdf7abfe5ed661ade9a6b2ba30fab4938bab477 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:19:36 +0900 Subject: [PATCH 074/147] =?UTF-8?q?ostreambuf=5Fiterator=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=E3=81=A8?= =?UTF-8?q?failed=20:=20=E4=BE=8B=E5=A4=96=E6=8C=87=E5=AE=9A=E3=82=92C++98?= =?UTF-8?q?=E3=81=A8C++11=E3=81=A7=E6=9B=B8=E3=81=8D=E5=88=86=E3=81=91?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/ostreambuf_iterator/failed.md | 3 ++- reference/iterator/ostreambuf_iterator/op_constructor.md | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/reference/iterator/ostreambuf_iterator/failed.md b/reference/iterator/ostreambuf_iterator/failed.md index c1aa1c874a..d2efc64d96 100644 --- a/reference/iterator/ostreambuf_iterator/failed.md +++ b/reference/iterator/ostreambuf_iterator/failed.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -bool failed() const noexcept; +bool failed() const throw(); // (1) C++98 +bool failed() const noexcept; // (1) C++11 ``` ## 概要 diff --git a/reference/iterator/ostreambuf_iterator/op_constructor.md b/reference/iterator/ostreambuf_iterator/op_constructor.md index af66a21ce2..766a431e5e 100644 --- a/reference/iterator/ostreambuf_iterator/op_constructor.md +++ b/reference/iterator/ostreambuf_iterator/op_constructor.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -ostreambuf_iterator(ostream_type& s) noexcept; -ostreambuf_iterator(streambuf_type* s) noexcept; +ostreambuf_iterator(ostream_type& s) throw(); // (1) C++98 +ostreambuf_iterator(ostream_type& s) noexcept; // (1) C++11 + +ostreambuf_iterator(streambuf_type* s) throw(); // (2) C++98 +ostreambuf_iterator(streambuf_type* s) noexcept; // (2) C++11 ``` ## ostreambuf_iteratorオブジェクトの構築 From 132d4251b5736257a1311232e56226f2d1a45c7d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:19:54 +0900 Subject: [PATCH 075/147] =?UTF-8?q?ostreambuf=5Fiterator=E3=81=AE=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E3=83=AA=E3=83=A1=E3=83=B3=E3=83=88=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=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/iterator/ostreambuf_iterator/op_increment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/iterator/ostreambuf_iterator/op_increment.md b/reference/iterator/ostreambuf_iterator/op_increment.md index 697523537e..8f3606b2eb 100644 --- a/reference/iterator/ostreambuf_iterator/op_increment.md +++ b/reference/iterator/ostreambuf_iterator/op_increment.md @@ -5,8 +5,8 @@ * function[meta id-type] ```cpp -ostreambuf_iterator& operator++(); -ostreambuf_iterator& operator++(int); +ostreambuf_iterator& operator++(); // (1) C++98 +ostreambuf_iterator& operator++(int); // (2) C++98 ``` ## 概要 From 9219395e619faafa7bc3c22f34382c9cf16b48c7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:21:44 +0900 Subject: [PATCH 076/147] =?UTF-8?q?reverse=5Fiterator=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=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/iterator/reverse_iterator/base.md | 4 ++-- reference/iterator/reverse_iterator/op_arrow.md | 6 +++--- reference/iterator/reverse_iterator/op_at.md | 4 ++-- reference/iterator/reverse_iterator/op_deref.md | 4 ++-- reference/iterator/reverse_iterator/op_equal.md | 4 ++-- reference/iterator/reverse_iterator/op_greater.md | 4 ++-- reference/iterator/reverse_iterator/op_greater_equal.md | 4 ++-- reference/iterator/reverse_iterator/op_less.md | 4 ++-- reference/iterator/reverse_iterator/op_less_equal.md | 4 ++-- reference/iterator/reverse_iterator/op_minus.md | 6 +++--- reference/iterator/reverse_iterator/op_minus_assign.md | 4 ++-- reference/iterator/reverse_iterator/op_not_equal.md | 4 ++-- reference/iterator/reverse_iterator/op_plus.md | 4 ++-- reference/iterator/reverse_iterator/op_plus_assign.md | 4 ++-- reference/iterator/reverse_iterator/op_unary_minus.md | 4 ++-- reference/iterator/reverse_iterator/op_unary_plus.md | 4 ++-- 16 files changed, 34 insertions(+), 34 deletions(-) diff --git a/reference/iterator/reverse_iterator/base.md b/reference/iterator/reverse_iterator/base.md index f7e52ffb6d..325f8bdedf 100644 --- a/reference/iterator/reverse_iterator/base.md +++ b/reference/iterator/reverse_iterator/base.md @@ -5,8 +5,8 @@ * function[meta id-type] ```cpp -Iterator base() const; // C++98 -constexpr Iterator base() const; // C++17 +Iterator base() const; // (1) C++98 +constexpr Iterator base() const; // (1) C++17 ``` ## 概要 diff --git a/reference/iterator/reverse_iterator/op_arrow.md b/reference/iterator/reverse_iterator/op_arrow.md index 17b879b48f..ad5b4c6b7a 100644 --- a/reference/iterator/reverse_iterator/op_arrow.md +++ b/reference/iterator/reverse_iterator/op_arrow.md @@ -5,9 +5,9 @@ * function[meta id-type] ```cpp -pointer operator->() const; // C++98 -constexpr pointer operator->() const; // C++17 -constexpr pointer operator->() const // C++20 +pointer operator->() const; // (1) C++98 +constexpr pointer operator->() const; // (1) C++17 +constexpr pointer operator->() const // (1) C++20 requires (is_pointer_v || requires (const Iterator i) { i.operator->(); }); ``` diff --git a/reference/iterator/reverse_iterator/op_at.md b/reference/iterator/reverse_iterator/op_at.md index bd5d84df76..9e5a5ccc9e 100644 --- a/reference/iterator/reverse_iterator/op_at.md +++ b/reference/iterator/reverse_iterator/op_at.md @@ -5,8 +5,8 @@ * function[meta id-type] ```cpp -unspecified operator[](difference_type n) const; // C++98 -constexpr unspecified operator[](difference_type n) const; // C++17 +unspecified operator[](difference_type n) const; // (1) C++98 +constexpr unspecified operator[](difference_type n) const; // (1) C++17 ``` * unspecified[italic] diff --git a/reference/iterator/reverse_iterator/op_deref.md b/reference/iterator/reverse_iterator/op_deref.md index 8737e8f3c2..cdde1efdb3 100644 --- a/reference/iterator/reverse_iterator/op_deref.md +++ b/reference/iterator/reverse_iterator/op_deref.md @@ -5,8 +5,8 @@ * function[meta id-type] ```cpp -reference operator*() const; // C++98 -constexpr reference operator*() const; // C++17 +reference operator*() const; // (1) C++98 +constexpr reference operator*() const; // (1) C++17 ``` ## 概要 diff --git a/reference/iterator/reverse_iterator/op_equal.md b/reference/iterator/reverse_iterator/op_equal.md index e605cd7d9c..5324c1e4e1 100644 --- a/reference/iterator/reverse_iterator/op_equal.md +++ b/reference/iterator/reverse_iterator/op_equal.md @@ -7,11 +7,11 @@ namespace std { template bool operator==(const reverse_iterator& x, - const reverse_iterator& y); // C++98 + const reverse_iterator& y); // (1) C++98 template constexpr bool operator==(const reverse_iterator& x, - const reverse_iterator& y); // C++17 + const reverse_iterator& y); // (1) C++17 } ``` diff --git a/reference/iterator/reverse_iterator/op_greater.md b/reference/iterator/reverse_iterator/op_greater.md index 5c2407eb27..083c750b53 100644 --- a/reference/iterator/reverse_iterator/op_greater.md +++ b/reference/iterator/reverse_iterator/op_greater.md @@ -7,11 +7,11 @@ namespace std { template bool operator>(const reverse_iterator& x, - const reverse_iterator& y); // C++98 + const reverse_iterator& y); // (1) C++98 template constexpr bool operator>(const reverse_iterator& x, - const reverse_iterator& y); // C++17 + const reverse_iterator& y); // (1) C++17 } ``` diff --git a/reference/iterator/reverse_iterator/op_greater_equal.md b/reference/iterator/reverse_iterator/op_greater_equal.md index e6d8786759..82976b9426 100644 --- a/reference/iterator/reverse_iterator/op_greater_equal.md +++ b/reference/iterator/reverse_iterator/op_greater_equal.md @@ -7,11 +7,11 @@ namespace std { template bool operator>=(const reverse_iterator& x, - const reverse_iterator& y); // C++98 + const reverse_iterator& y); // (1) C++98 template constexpr bool operator>=(const reverse_iterator& x, - const reverse_iterator& y); // C++17 + const reverse_iterator& y); // (1) C++17 } ``` diff --git a/reference/iterator/reverse_iterator/op_less.md b/reference/iterator/reverse_iterator/op_less.md index 68a9931025..89f8c4245f 100644 --- a/reference/iterator/reverse_iterator/op_less.md +++ b/reference/iterator/reverse_iterator/op_less.md @@ -7,11 +7,11 @@ namespace std { template bool operator<(const reverse_iterator& x, - const reverse_iterator& y); // C++98 + const reverse_iterator& y); // (1) C++98 template constexpr bool operator<(const reverse_iterator& x, - const reverse_iterator& y); // C++17 + const reverse_iterator& y); // (1) C++17 } ``` diff --git a/reference/iterator/reverse_iterator/op_less_equal.md b/reference/iterator/reverse_iterator/op_less_equal.md index 6b78277a39..84d8501bd7 100644 --- a/reference/iterator/reverse_iterator/op_less_equal.md +++ b/reference/iterator/reverse_iterator/op_less_equal.md @@ -7,11 +7,11 @@ namespace std { template bool operator<=(const reverse_iterator& x, - const reverse_iterator& y); // C++98 + const reverse_iterator& y); // (1) C++98 template constexpr bool operator<=(const reverse_iterator& x, - const reverse_iterator& y); // C++17 + const reverse_iterator& y); // (1) C++17 } ``` diff --git a/reference/iterator/reverse_iterator/op_minus.md b/reference/iterator/reverse_iterator/op_minus.md index 03addd5983..fdfe1bdb10 100644 --- a/reference/iterator/reverse_iterator/op_minus.md +++ b/reference/iterator/reverse_iterator/op_minus.md @@ -8,17 +8,17 @@ namespace std { template typename reverse_iterator::difference_type operator-(const reverse_iterator& x, - const reverse_iterator& y); // C++98 + const reverse_iterator& y); // (1) C++98 template auto operator-(const reverse_iterator& x, const reverse_iterator& y) - -> decltype(y.current - x.current); // C++11 + -> decltype(y.current - x.current); // (1) C++11 template constexpr auto operator-(const reverse_iterator& x, const reverse_iterator& y) - -> decltype(y.current - x.current); // C++17 + -> decltype(y.current - x.current); // (1) C++17 } ``` diff --git a/reference/iterator/reverse_iterator/op_minus_assign.md b/reference/iterator/reverse_iterator/op_minus_assign.md index ba38d56264..47ea774172 100644 --- a/reference/iterator/reverse_iterator/op_minus_assign.md +++ b/reference/iterator/reverse_iterator/op_minus_assign.md @@ -5,8 +5,8 @@ * function[meta id-type] ```cpp -reverse_iterator& operator-=(difference_type n); // C++98 -constexpr reverse_iterator& operator-=(difference_type n); // C++17 +reverse_iterator& operator-=(difference_type n); // (1) C++98 +constexpr reverse_iterator& operator-=(difference_type n); // (1) C++17 ``` ## 概要 diff --git a/reference/iterator/reverse_iterator/op_not_equal.md b/reference/iterator/reverse_iterator/op_not_equal.md index 8f0e851e6f..fe157d0228 100644 --- a/reference/iterator/reverse_iterator/op_not_equal.md +++ b/reference/iterator/reverse_iterator/op_not_equal.md @@ -7,11 +7,11 @@ namespace std { template bool operator!=(const reverse_iterator& x, - const reverse_iterator& y); // C++98 + const reverse_iterator& y); // (1) C++98 template constexpr bool operator!=(const reverse_iterator& x, - const reverse_iterator& y); // C++17 + const reverse_iterator& y); // (1) C++17 } ``` diff --git a/reference/iterator/reverse_iterator/op_plus.md b/reference/iterator/reverse_iterator/op_plus.md index d024e5d596..5e8fad4734 100644 --- a/reference/iterator/reverse_iterator/op_plus.md +++ b/reference/iterator/reverse_iterator/op_plus.md @@ -8,12 +8,12 @@ namespace std { template reverse_iterator operator+( typename reverse_iterator::difference_type n, - const reverse_iterator& x); // C++98 + const reverse_iterator& x); // (1) C++98 template constexpr reverse_iterator operator+( typename reverse_iterator::difference_type n, - const reverse_iterator& x); // C++17 + const reverse_iterator& x); // (1) C++17 } ``` diff --git a/reference/iterator/reverse_iterator/op_plus_assign.md b/reference/iterator/reverse_iterator/op_plus_assign.md index 0e38bbabd9..a15ef9fcc1 100644 --- a/reference/iterator/reverse_iterator/op_plus_assign.md +++ b/reference/iterator/reverse_iterator/op_plus_assign.md @@ -5,8 +5,8 @@ * function[meta id-type] ```cpp -reverse_iterator& operator+=(difference_type n); // C++98 -constexpr reverse_iterator& operator+=(difference_type n); // C++17 +reverse_iterator& operator+=(difference_type n); // (1) C++98 +constexpr reverse_iterator& operator+=(difference_type n); // (1) C++17 ``` ## 概要 diff --git a/reference/iterator/reverse_iterator/op_unary_minus.md b/reference/iterator/reverse_iterator/op_unary_minus.md index 7c340c9c89..608cb60633 100644 --- a/reference/iterator/reverse_iterator/op_unary_minus.md +++ b/reference/iterator/reverse_iterator/op_unary_minus.md @@ -5,8 +5,8 @@ * function[meta id-type] ```cpp -reverse_iterator operator-(difference_type n) const; // C++98 -constexpr reverse_iterator operator-(difference_type n) const; // C++17 +reverse_iterator operator-(difference_type n) const; // (1) C++98 +constexpr reverse_iterator operator-(difference_type n) const; // (1) C++17 ``` ## 概要 diff --git a/reference/iterator/reverse_iterator/op_unary_plus.md b/reference/iterator/reverse_iterator/op_unary_plus.md index a83d85977e..3aadc7353c 100644 --- a/reference/iterator/reverse_iterator/op_unary_plus.md +++ b/reference/iterator/reverse_iterator/op_unary_plus.md @@ -5,8 +5,8 @@ * function[meta id-type] ```cpp -reverse_iterator operator+(difference_type n) const; // C++98 -constexpr reverse_iterator operator+(difference_type n) const; // C++17 +reverse_iterator operator+(difference_type n) const; // (1) C++98 +constexpr reverse_iterator operator+(difference_type n) const; // (1) C++17 ``` ## 概要 From 917e2a6562bc7c61cf891334f729f4da9ccc4a1a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:22:22 +0900 Subject: [PATCH 077/147] =?UTF-8?q?reverse=5Fiterator=E3=81=AE=E4=BB=A3?= =?UTF-8?q?=E5=85=A5=E6=BC=94=E7=AE=97=E5=AD=90=20:=20=E5=B0=8E=E5=85=A5?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=92C++98?= =?UTF-8?q?=E3=81=8B=E3=82=89C++11=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iterator/reverse_iterator/op_assign.md | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/reference/iterator/reverse_iterator/op_assign.md b/reference/iterator/reverse_iterator/op_assign.md index dc00583993..b77cac3dbd 100644 --- a/reference/iterator/reverse_iterator/op_assign.md +++ b/reference/iterator/reverse_iterator/op_assign.md @@ -3,26 +3,24 @@ * std[meta namespace] * reverse_iterator[meta class] * function[meta id-type] +* cpp11[meta cpp] ```cpp -reverse_iterator& operator=(const reverse_iterator& u) = default; // (1) C++98 -constexpr reverse_iterator& operator=(const reverse_iterator& u) = default; // (1) C++17 - template -reverse_iterator& operator=(const reverse_iterator& u); // (2) C++98 +reverse_iterator& operator=(const reverse_iterator& u); // (1) C++11 template -constexpr reverse_iterator& operator=(const reverse_iterator& u); // (2) C++17 +constexpr reverse_iterator& operator=(const reverse_iterator& u); // (1) C++17 ``` ## 概要 -- (2) : `u.base()`をメンバ変数`current`に保持する。 +- (1) : `u.base()`をメンバ変数`current`に保持する。 ## テンプレートパラメータ制約 - C++17まで - - (2) : `U`が`Iterator`に変換可能であること + - (1) : `U`が`Iterator`に変換可能であること - C++20 - - (2) : 次の両方を満たす + - (1) : 次の両方を満たす - `is_same_v == false`であること。 - `const U&, Iterator`が[`convertible_to`](/reference/concepts/convertible_to.md)のモデルとなること。 - `Iterator&, const U&`が[`assignable_from`](/reference/concepts/assignable_from.md)のモデルとなること。 @@ -32,6 +30,11 @@ constexpr reverse_iterator& operator=(const reverse_iterator& u); // ( `*this` +## 備考 +- C++98では、このクラスに`operator=`は宣言されていなかった。そのため、同じ型の`reverse_iterator`どうしの代入は暗黙に宣言されるコピー代入演算子によって行えたが、変換可能な別の型の`reverse_iterator`を代入することはできなかった。 +- (1)が追加されたあとも、同じ型どうしの代入は、暗黙に宣言されるコピー代入演算子によって行われる。 + + ## 例 ```cpp example #include @@ -69,6 +72,13 @@ int main() 1 ``` +## バージョン +### 言語 +- C++11 + + ## 参照 +- [LWG Issue 280. Comparison of `reverse_iterator` to `const reverse_iterator`](https://cplusplus.github.io/LWG/issue280) + - C++11で、変換可能な`reverse_iterator`を代入できるよう、テンプレート版の代入演算子(1)が追加された。テンプレート版のコンストラクタは既にあったが、代入演算子は用意されていなかった - [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) - [LWG Issue 3435. `three_way_comparable_with, reverse_iterator>`](https://cplusplus.github.io/LWG/issue3435) From 756de455cfe835c4611810bee0d5ee0f90caf164 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:23:00 +0900 Subject: [PATCH 078/147] =?UTF-8?q?reverse=5Fiterator=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=83=87=E3=83=95=E3=82=A9=E3=83=AB=E3=83=88=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=E5=80=A4?= =?UTF-8?q?=E5=88=9D=E6=9C=9F=E5=8C=96=E3=81=99=E3=82=8B=E3=81=93=E3=81=A8?= =?UTF-8?q?=E3=81=8C=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/iterator/reverse_iterator/op_constructor.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reference/iterator/reverse_iterator/op_constructor.md b/reference/iterator/reverse_iterator/op_constructor.md index b4d797854f..052f826282 100644 --- a/reference/iterator/reverse_iterator/op_constructor.md +++ b/reference/iterator/reverse_iterator/op_constructor.md @@ -21,7 +21,9 @@ constexpr reverse_iterator(const reverse_iterator& u); // (3) C++17 ## 概要 `reverse_iterator`オブジェクトを構築する。 -- (1) : デフォルトコンストラクタ。内容する元となるイテレータである`current`メンバ変数を、`Iterator`の初期化された値を使用して初期化する。 +- (1) : デフォルトコンストラクタ。内包する元となるイテレータである`current`メンバ変数を初期化する。 + - C++98 : `current`をデフォルト初期化する + - C++11 : `current`を値初期化する。このイテレータに対する操作は、値初期化された`Iterator`型のイテレータに対して対応する操作が定義されている場合にのみ、定義された動作をする - (2) : 元となるイテレータ`x`を受け取り、メンバ変数`current`に保持する。 - (3) : `u.current`をメンバ変数`current`に保持する。 @@ -67,4 +69,6 @@ int main() ## 参照 - [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) +- [LWG Issue 1012. `reverse_iterator` default ctor should value initialize](https://cplusplus.github.io/LWG/issue1012) + - C++11で、デフォルトコンストラクタの効果が、内包するイテレータのデフォルト初期化から値初期化へ改められた - [LWG Issue 3435. `three_way_comparable_with, reverse_iterator>`](https://cplusplus.github.io/LWG/issue3435) From 39795f62d5574da18c763b2fafded096d5e2d8a4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:23:12 +0900 Subject: [PATCH 079/147] =?UTF-8?q?next=20:=20LWG=20Issue=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/next.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/iterator/next.md b/reference/iterator/next.md index fe30f3b9d2..a56771bf7d 100644 --- a/reference/iterator/next.md +++ b/reference/iterator/next.md @@ -84,5 +84,7 @@ int main() ## 参照 - [boost::next() - Boost Utility Library](http://www.boost.org/doc/libs/release/libs/utility/utility.htm#functions_next_prior) - [N2246 2 of the least crazy ideas for the standard library in C++0x](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2246.html) -- [LWG Issue 2353. `std::next` is over-constrained](https://wg21.cmeerw.net/lwg/issue2353) +- [LWG Issue 1011. next/prev wrong iterator type](https://cplusplus.github.io/LWG/issue1011) + - C++11で、テンプレートパラメータが`InputIterator`から`ForwardIterator`へ改められた。入力イテレータでは進めたあとに元のイテレータのコピーを返すことができないため - [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) +- [LWG Issue 2353. `std::next` is over-constrained](https://wg21.cmeerw.net/lwg/issue2353) From fe7ab31672aa9e3800405e3d1ae35e1f19d91959 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:23:41 +0900 Subject: [PATCH 080/147] =?UTF-8?q?money=5Fget::do=5Fget=20:=20LWG=20Issue?= =?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/locale/money_get/do_get.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/locale/money_get/do_get.md b/reference/locale/money_get/do_get.md index 09137b3439..9f7cf27665 100644 --- a/reference/locale/money_get/do_get.md +++ b/reference/locale/money_get/do_get.md @@ -93,3 +93,8 @@ ct.widen(src, src + sizeof(src) - 1, atoms); - [`money_get::get`](get.md) - [`moneypunct`](/reference/locale/moneypunct.md) - [`money_base`](/reference/locale/money_base.md) + + +## 参照 +- [LWG Issue 836. Effects of `money_base::space` and `money_base::none` on `money_get`](https://cplusplus.github.io/LWG/issue836) + - C++11で、書式パターン中の[`money_base::space`](/reference/locale/money_base.md)と[`money_base::none`](/reference/locale/money_base.md)に対する空白の消費規則が、位置ごとに明確化された From 7092d1701b70adc019736e40b285b27064cafd09 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:23:59 +0900 Subject: [PATCH 081/147] =?UTF-8?q?num=5Fput::do=5Fput=20:=20LWG=20Issue?= =?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/locale/num_put/do_put.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/locale/num_put/do_put.md b/reference/locale/num_put/do_put.md index b1d3b5d0b8..91a2637ac5 100644 --- a/reference/locale/num_put/do_put.md +++ b/reference/locale/num_put/do_put.md @@ -125,6 +125,10 @@ Stage 3の終了時点での`charT`の列が、`*out++ = c`によって出力さ ## 参照 +- [LWG Issue 671. precision of hexfloat](https://cplusplus.github.io/LWG/issue671) + - C++11で、浮動小数点数の出力において`str.precision()`が精度として使われるのは`floatfield != (fixed | scientific)`の場合に限られ、`%a`/`%A`(16進浮動小数点)では精度を指定しないことが明記された +- [LWG Issue 1152. Expressions parsed differently than intended](https://cplusplus.github.io/LWG/issue1152) + - C++11で、浮動小数点数の変換指定を決める条件の`floatfield == ios_base::fixed | ios_base::scientific`にカッコが補われた。演算子の優先順位により意図と異なる解釈になっていたため - [LWG Issue 2293. Wrong facet used by `num_put::do_put`](https://cplusplus.github.io/LWG/issue2293) - C++14で、`bool`版が[`truename()`](/reference/locale/numpunct/truename.md)・[`falsename()`](/reference/locale/numpunct/falsename.md)を取得するファセットが、[`ctype`](/reference/locale/ctype.md)から[`numpunct`](/reference/locale/numpunct.md)へ修正された - この修正は欠陥報告(DR)であり、C++98以降に遡及して適用される。これらのメンバ関数を持つのは[`numpunct`](/reference/locale/numpunct.md)であり、[`ctype`](/reference/locale/ctype.md)を指定した元の規定は実装不可能だったため From 32e51f915d6b97e6c6c9696a8417686d23b0670c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:24:16 +0900 Subject: [PATCH 082/147] =?UTF-8?q?num=5Fget::do=5Fget=20:=20C++98?= =?UTF-8?q?=E4=BB=95=E6=A7=98=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/locale/num_get/do_get.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reference/locale/num_get/do_get.md b/reference/locale/num_get/do_get.md index 9332eebfca..ad57d5d2d2 100644 --- a/reference/locale/num_get/do_get.md +++ b/reference/locale/num_get/do_get.md @@ -78,7 +78,9 @@ Stage 2で蓄積した文字列(フィールド)を、[``](/referen 格納される値は以下のいずれかであり、いずれの場合も結果は`val`へ格納される。 -- (2)〜(11) : 変換関数がフィールド全体を変換しなかった場合、`0` +- (2)〜(11) : 変換関数がフィールド全体を変換しなかった場合 + - C++98 : 値は格納されない + - C++11 : `0` - (2), (3) : `val`に表現できないほど大きな正(負)の値を表す場合、表現可能な最大(最小)の値 - (4), (5), (6), (7) : `val`に表現できない値を表す場合、表現可能な最大の値 - (2)〜(11) : それ以外の場合、変換された値 @@ -113,5 +115,9 @@ Stage 2で蓄積した文字列(フィールド)を、[``](/referen ## 参照 +- [LWG Issue 696. `istream::operator>>`(int&) broken](https://cplusplus.github.io/LWG/issue696) + - C++11で、変換に失敗した場合に値を変更しないという記述が削除され、抽出に失敗した場合は`0`が代入されるという規定に一本化された。整数の抽出をより広い型で行ってから範囲検査する規定と矛盾していたため - [LWG Issue 1169. `num_get` not fully compatible with `strto*`](https://cplusplus.github.io/LWG/issue1169) - C++17で、`float`に`std::strtof`、`long double`に`std::strtold`を使用することが明示され(`std::strtoll`/`std::strtoull`/`std::strtod`は変更なし)、符号なし整数型で表現できない値に対しては(正負によらず)常に表現可能な最大の値を格納する形に整理された。これによりC標準ライブラリと整合するようになった +- [LWG Issue 2041. Stage 2 accumulate incompatibilty](https://cplusplus.github.io/LWG/issue2041) + - C++11で、Stage 2において、変換指定に対して許容される文字であるかの検査を行ってから蓄積することが明記された From dcf61e33bf20db48f9e4769d9267c65f3b9311fd Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:24:52 +0900 Subject: [PATCH 083/147] =?UTF-8?q?wstring=5Fconvert,=20wbuffer=5Fconvert?= =?UTF-8?q?=20:=20LWG=20Issue=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/locale/wbuffer_convert.md | 2 ++ reference/locale/wstring_convert.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/reference/locale/wbuffer_convert.md b/reference/locale/wbuffer_convert.md index 91e8ae58e6..1307c90a6f 100644 --- a/reference/locale/wbuffer_convert.md +++ b/reference/locale/wbuffer_convert.md @@ -67,3 +67,5 @@ 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) +- [LWG Issue 1252. `wbuffer_convert::state_type` inconsistency](https://cplusplus.github.io/LWG/issue1252) + - C++11で、`state_type`の定義が`Tr::state_type`から`Codecvt::state_type`へ修正された。変換状態は`codecvt`側の型であるため diff --git a/reference/locale/wstring_convert.md b/reference/locale/wstring_convert.md index c15e88ba2b..0b50b6fa11 100644 --- a/reference/locale/wstring_convert.md +++ b/reference/locale/wstring_convert.md @@ -123,3 +123,5 @@ 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) +- [LWG Issue 991. Provide allocator for `wstring_convert`](https://cplusplus.github.io/LWG/issue991) + - C++11で、変換結果の文字列に使用するアロケータを指定するテンプレートパラメータ`Wide_alloc`と`Byte_alloc`が追加された From 2dd4f4ff9df0aad3c4002275972920b0a0d06936 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:25:04 +0900 Subject: [PATCH 084/147] =?UTF-8?q?ctype=5Fbyname=20:=20LWG=20Issue?= =?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/locale/ctype_byname.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/locale/ctype_byname.md b/reference/locale/ctype_byname.md index 90806bed8b..cd0a9977ff 100644 --- a/reference/locale/ctype_byname.md +++ b/reference/locale/ctype_byname.md @@ -73,3 +73,8 @@ true ## 関連項目 - [`ctype`](/reference/locale/ctype.md) - [`locale`](locale.md) + + +## 参照 +- [LWG Issue 1298. Missing specialization of `ctype_byname`](https://cplusplus.github.io/LWG/issue1298) + - C++11で、`char`に対する明示的特殊化の宣言が削除された。特殊化の内容が規定されておらず、基本テンプレートで足りるため From 66a1c9dcb7360e27710d033594a4e310f17582ab Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:25:52 +0900 Subject: [PATCH 085/147] =?UTF-8?q?locale=20:=20C++11=E3=81=A7isblank?= =?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/locale.md | 1 + reference/locale/isblank.md | 77 +++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 reference/locale/isblank.md diff --git a/reference/locale.md b/reference/locale.md index 8cff9db03a..09c3c013f7 100644 --- a/reference/locale.md +++ b/reference/locale.md @@ -28,6 +28,7 @@ | [`isxdigit`](locale/isxdigit.md) | 十六進数字の判定(function) | | | [`isalnum`](locale/isalnum.md) | 英字・数字の判定(function) | | | [`isgraph`](locale/isgraph.md) | 図形文字の判定(function) | | +| [`isblank`](locale/isblank.md) | ブランク文字の判定(function) | C++11 | | [`toupper`](locale/toupper.md) | 英大文字への変換(function) | | | [`tolower`](locale/tolower.md) | 英小文字への変換(function) | | | [`wstring_convert`](locale/wstring_convert.md) | `codecvt`による文字列変換(class template) | C++11
C++17から非推奨
C++26で削除 | diff --git a/reference/locale/isblank.md b/reference/locale/isblank.md new file mode 100644 index 0000000000..794915c488 --- /dev/null +++ b/reference/locale/isblank.md @@ -0,0 +1,77 @@ +# isblank +* locale[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp11[meta cpp] + +```cpp +namespace std { + template + bool isblank(charT c, const locale& loc); // (1) C++11 +} +``` + +## 概要 +`locale`を引数で指定できる`isblank()`関数。 +文字`c`がブランク文字であるかどうかを、ロケールに基いて判定する。 + +ブランク文字とは、テキストの1行を単語に区切るために使われる、空白文字の一種である。`"C"`ロケールでは、半角スペースと水平タブがこれにあたる。 + + +## 戻り値 +`std::`[`use_facet`](use_facet.md)`>(loc).is(std::`[`ctype_base`](ctype_base.md)`::blank, c)`を返す。 + + +## 備考 +`locale`を引数に取らない`isblank()`関数は、[``](/reference/cctype.md)ヘッダに存在する。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::locale l = std::locale::classic(); + + std::cout << std::boolalpha << std::isblank(' ', l) << std::endl; + std::cout << std::isblank('a', l) << std::endl; +} +``` +* std::isblank[color ff0000] +* std::locale[link locale.md] +* classic()[link locale/classic.md] + +### 出力 +``` +true +false +``` + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 実装例 +```cpp +template +bool isblank(charT c, const locale& loc) +{ + return std::use_facet>(loc).is(std::ctype_base::blank, c); +} +``` + +## 関連項目 +- [`ctype`](ctype.md) +- [`ctype_base`](ctype_base.md) +- [`isblank - `](/reference/cctype/isblank.md) + +## 参照 +- [LWG Issue 2019. `isblank` not supported by `std::locale`](https://cplusplus.github.io/LWG/issue2019) + - C++11で、`ctype_base::blank`が追加されたにもかかわらず、対応する`std::isblank`が``に用意されていなかったため、追加された From 6b5e5b65843763ca55da4e4053002c21813b3bc0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:26:25 +0900 Subject: [PATCH 086/147] =?UTF-8?q?locale=20:=20=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=BB=E3=83=83=E3=83=88=E3=81=AE=E4=BB=AE=E6=83=B3=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E3=81=8C=E5=88=A5=E3=81=AE=E4=BB=AE=E6=83=B3=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E3=82=92=E5=91=BC=E3=81=B3=E5=87=BA=E3=81=99=E3=81=8B?= =?UTF-8?q?=E3=81=A9=E3=81=86=E3=81=8B=E3=81=8C=E6=9C=AA=E8=A6=8F=E5=AE=9A?= =?UTF-8?q?=E3=81=A7=E3=81=82=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C=E6=98=8E?= =?UTF-8?q?=E8=A8=98=E3=81=95=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/locale.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/reference/locale.md b/reference/locale.md index 09c3c013f7..57077f4d85 100644 --- a/reference/locale.md +++ b/reference/locale.md @@ -88,3 +88,14 @@ | [`messages_base`](locale/messages_base.md) | メッセージ取得のための基底クラス(class) | | | [`messages`](locale/messages.md) | メッセージカタログから対応する翻訳メッセージの取得(class template) | | | [`messages_byname`](locale/messages_byname.md) | 名前による翻訳メッセージの取得(class template) | | + + +## 備考 +ロケールファセットにおいて、ある仮想関数が別の仮想関数を呼び出すかどうかは未規定である。 + +そのため、たとえば[`ctype`](locale/ctype.md)を継承して[`do_widen`](locale/ctype/do_widen.md)の1引数版だけをオーバーライドしても、範囲版が内部でそれを呼び出す保証はない。挙動を変更したい場合は、対応する仮想関数をすべてオーバーライドする必要がある。 + + +## 参照 +- [LWG Issue 473. underspecified `ctype` calls](https://cplusplus.github.io/LWG/issue473) + - C++11で、ロケールファセットのある仮想関数が別の仮想関数を呼び出すかどうかは未規定であると明記された。それ以前も呼び出し関係は規定されておらず、片方だけをオーバーライドしたときの挙動は処理系によって異なっていた From d673c9d48a8e909d556f6773826d4f829a219f63 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:26:54 +0900 Subject: [PATCH 087/147] =?UTF-8?q?allocator=5Ftraits=20:=20LWG=20Issue?= =?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/memory/allocator_traits.md | 2 ++ reference/memory/allocator_traits/construct.md | 2 ++ .../allocator_traits/select_on_container_copy_construction.md | 2 ++ 3 files changed, 6 insertions(+) diff --git a/reference/memory/allocator_traits.md b/reference/memory/allocator_traits.md index 0b4df91c71..2cc5383a14 100644 --- a/reference/memory/allocator_traits.md +++ b/reference/memory/allocator_traits.md @@ -212,3 +212,5 @@ int main() { - [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) +- [LWG Issue 1404. `pointer_traits` should have a `size_type` member](https://cplusplus.github.io/LWG/issue1404) + - C++11で、アロケータのメンバ型が省略された場合の既定値が、`size_t`/`ptrdiff_t`から[`pointer_traits`](pointer_traits.md)と[`make_unsigned`](/reference/type_traits/make_unsigned.md)を用いて導出する形へ改められた。独自のポインタ型を持つアロケータに対応するため diff --git a/reference/memory/allocator_traits/construct.md b/reference/memory/allocator_traits/construct.md index 10c4ff427e..8b10ca5c3b 100644 --- a/reference/memory/allocator_traits/construct.md +++ b/reference/memory/allocator_traits/construct.md @@ -76,3 +76,5 @@ int main() ## 参照 - [P0784R7 More constexpr containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0784r7.html) +- [LWG Issue 1285. `allocator_traits` call to new](https://cplusplus.github.io/LWG/issue1285) + - C++11で、要素の構築に使用する配置newが`::new`と、グローバル名前空間を明示する形へ改められた。クラス独自の`operator new`が使用されないようにするため 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 d2b54a3a70..aa76000a73 100644 --- a/reference/memory/allocator_traits/select_on_container_copy_construction.md +++ b/reference/memory/allocator_traits/select_on_container_copy_construction.md @@ -124,3 +124,5 @@ int main() ## 参照 - [P0784R7 More constexpr containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0784r7.html) +- [LWG Issue 1286. `allocator_traits::select_on_container_copy_construction` type-o](https://cplusplus.github.io/LWG/issue1286) + - C++11で、戻り値の記述にあった`rhs.select_on_container_copy_construction(a)`という誤記が、引数のない`rhs.select_on_container_copy_construction()`へ修正された From 58664e756518ab23b261b40ecab775e47c36de14 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:27:35 +0900 Subject: [PATCH 088/147] =?UTF-8?q?shared=5Fptr::get=20:=20=E3=82=A8?= =?UTF-8?q?=E3=82=A4=E3=83=AA=E3=82=A2=E3=82=B9=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=82=92=E8=80=83=E6=85=AE?= =?UTF-8?q?=E3=81=97=E3=81=9F=E4=BB=95=E6=A7=98=E3=81=AB=E3=81=AA=E3=81=A3?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/shared_ptr/get.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reference/memory/shared_ptr/get.md b/reference/memory/shared_ptr/get.md index 0868a48b37..5b21067984 100644 --- a/reference/memory/shared_ptr/get.md +++ b/reference/memory/shared_ptr/get.md @@ -21,6 +21,8 @@ constexpr element_type* ## 戻り値 保持しているポインタを返す。 +空の`shared_ptr`が保持しているポインタは必ずしもヌルポインタではない。[エイリアスコンストラクタ](op_constructor.md)を使うと、所有権を持たずに非ヌルのポインタを保持する`shared_ptr`を構築できるためである。 + ## 備考 リソースの所有権は`*this`が持っているので、この関数によって返されたポインタに対して、リソース解放をしてはならない。 @@ -60,4 +62,6 @@ 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 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) +- [LWG Issue 711. Contradiction in empty `shared_ptr`](https://cplusplus.github.io/LWG/issue711) + - C++11で、「空の場合はヌルポインタを返す」という記述が削除された。エイリアスコンストラクタにより、空でありながら非ヌルのポインタを保持する`shared_ptr`を構築できるため、この記述は矛盾していた From 7b1ef2bf1782fc5097f52faf1c61dfc7720b883c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:27:55 +0900 Subject: [PATCH 089/147] =?UTF-8?q?shared=5Fptr=20:=20LWG=20Issue=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/shared_ptr.md | 4 ++++ reference/memory/shared_ptr/op_constructor.md | 10 +++++++++- reference/memory/shared_ptr/op_destructor.md | 4 +++- reference/memory/shared_ptr/op_less.md | 2 ++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/reference/memory/shared_ptr.md b/reference/memory/shared_ptr.md index a563b686f5..8df659af18 100644 --- a/reference/memory/shared_ptr.md +++ b/reference/memory/shared_ptr.md @@ -227,3 +227,7 @@ Y dtor - [P0163R0 `shared_ptr::weak_type`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0163r0.html) - [P0414R1 Merging `shared_ptr` changes from Library Fundamentals to C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0414r1.html) - [P0619R4 Reviewing deprecated facilities of C++17 for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0619r4.html) +- [LWG Issue 896. Library thread safety issue](https://cplusplus.github.io/LWG/issue896) + - C++11で、データ競合の有無を判定する上で、メンバ関数がアクセス・変更するのは`shared_ptr`と[`weak_ptr`](weak_ptr.md)のオブジェクト自体であって、それらが参照するオブジェクトではないことが明記された +- [LWG Issue 978. Hashing smart pointers](https://cplusplus.github.io/LWG/issue978) + - C++11で、[`hash`](/reference/functional/hash.md)クラスの特殊化が追加された。非順序連想コンテナのキーとしてスマートポインタを使えるようにするため diff --git a/reference/memory/shared_ptr/op_constructor.md b/reference/memory/shared_ptr/op_constructor.md index db27eda369..7fafa2157c 100644 --- a/reference/memory/shared_ptr/op_constructor.md +++ b/reference/memory/shared_ptr/op_constructor.md @@ -342,11 +342,20 @@ int main() - [N4190 Removing `auto_ptr`, `random_shuffle()`, And Old `` Stuff](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4190.htm) - [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 758. `shared_ptr` and `nullptr`](https://cplusplus.github.io/LWG/issue758) + - C++11で、削除子(とアロケータ)を`nullptr`とともに渡すオーバーロードが追加された。`Y*`をとるオーバーロードでは`nullptr`から`Y`を推論できないため、削除子付きの空の`shared_ptr`を構築できなかった +- [LWG Issue 881. `shared_ptr` conversion issue](https://cplusplus.github.io/LWG/issue881) + - C++11で、(11)のムーブコンストラクタの`Y*`から`T*`への変換可能性が、単なる要件からオーバーロード解決に参加する条件へ改められた +- [LWG Issue 925. `shared_ptr`'s explicit conversion from `unique_ptr`](https://cplusplus.github.io/LWG/issue925) + - C++11で、[`unique_ptr`](/reference/memory/unique_ptr.md)および`auto_ptr`から構築するコンストラクタの`explicit`指定が外された。これらからの所有権の移動は安全であり、暗黙変換を禁止する理由がなかったため +- [LWG Issue 1402. `nullptr` constructors for smart pointers should be `constexpr`](https://cplusplus.github.io/LWG/issue1402) + - C++11で、[`nullptr`](/reference/cstddef/nullptr_t.md)からのコンストラクタに`constexpr`が付加された。デフォルトコンストラクタと同様に、静的初期化できるようにするため - [LWG Issue 2365. Missing `noexcept` in `shared_ptr::shared_ptr(nullptr_t)`](https://wg21.cmeerw.net/lwg/issue2365) - [LWG Issue 2685. `shared_ptr` deleters must not throw on move construction](https://cplusplus.github.io/LWG/issue2685) - C++17で、削除子`D`の構築(`CopyConstructible`は維持)が例外を投げないという要件が追加された - [LWG Issue 2802. `shared_ptr` constructor requirements for a deleter](https://cplusplus.github.io/LWG/issue2802) - C++17で、削除子`D`の要件が`CopyConstructible`から`MoveConstructible`に緩和され、`d`および`std::move(d)`からの構築が例外を投げないこと、`d(p)`が適格であり定義された動作をし、例外を投げないことが規定された。あわせて「`D`のデストラクタが例外を投げない」要件は削除された +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) - [LWG Issue 2874. Constructor `shared_ptr::shared_ptr(Y*)` should be constrained](https://cplusplus.github.io/LWG/issue2874) - C++17で、ポインタから構築するコンストラクタが、`delete p`(配列版は`delete[] p`)が妥当で`Y*`が`T*`と互換な場合のみオーバーロード解決に参加するよう制約化された - [LWG Issue 2875. `shared_ptr::shared_ptr(Y* | D | […])` constructors should be constrained](https://cplusplus.github.io/LWG/issue2875) @@ -354,4 +363,3 @@ int main() - [LWG Issue 2876. `shared_ptr::shared_ptr(const weak_ptr&)` constructor should be constrained](https://cplusplus.github.io/LWG/issue2876) - C++17で、`weak_ptr`から構築するコンストラクタ(12)が、`Y*`が`T*`と互換な場合のみオーバーロード解決に参加するよう制約化され、`is_constructible`が正しい結果を返すようになった - [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) diff --git a/reference/memory/shared_ptr/op_destructor.md b/reference/memory/shared_ptr/op_destructor.md index ba7e8ade1f..944cd3fe33 100644 --- a/reference/memory/shared_ptr/op_destructor.md +++ b/reference/memory/shared_ptr/op_destructor.md @@ -71,4 +71,6 @@ 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 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) +- [LWG Issue 899. Adjusting `shared_ptr` for `nullptr_t`](https://cplusplus.github.io/LWG/issue899) + - C++11で、削除子を呼び出す条件の記述が「ポインタ`p`を所有している場合」から「オブジェクト`p`を所有している場合」へ改められた。`nullptr`と削除子から構築した`shared_ptr`でも削除子が呼ばれることを明確にするため diff --git a/reference/memory/shared_ptr/op_less.md b/reference/memory/shared_ptr/op_less.md index 9bf2bc0c44..64c93cb435 100644 --- a/reference/memory/shared_ptr/op_less.md +++ b/reference/memory/shared_ptr/op_less.md @@ -86,6 +86,8 @@ true - [P0497R0 Fixes to `shared_ptr` support for arrays](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0497r0.html) - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [LWG Issue 1262. `std::less>` is underspecified](https://cplusplus.github.io/LWG/issue1262) + - C++11で、戻り値が`a.get() < b.get()`から[`less`](/reference/functional/less.md)を用いた比較へ改められた。無関係なポインタ同士でも全順序となることを保証するため - [LWG Issue 2908. The less-than operator for shared pointers could do more](https://cplusplus.github.io/LWG/issue2908) - C++17で、合成ポインタ型を用いる規定から`less<>`(透過的な`less`)を用いる形に規定が簡素化された。比較可能な組み合わせ自体は変わらない(コア言語の`operator<`が常に合成ポインタ型を形成するため、元の規定でも同等に一般的だった) - この修正は欠陥報告(DR)であり、C++11以降に遡及して適用される。観測可能な挙動を変えない規定の簡素化であるため From 107cd31731e391599094dde16c49c822f7e20c32 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:28:28 +0900 Subject: [PATCH 090/147] =?UTF-8?q?unique=5Fptr=20:=20LWG=20Issue=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/unique_ptr.md | 2 ++ reference/memory/unique_ptr/op_assign.md | 8 ++++++-- reference/memory/unique_ptr/op_constructor.md | 6 +++++- reference/memory/unique_ptr/op_equal.md | 2 ++ reference/memory/unique_ptr/op_greater.md | 4 +++- reference/memory/unique_ptr/op_greater_equal.md | 4 +++- reference/memory/unique_ptr/op_less.md | 4 +++- reference/memory/unique_ptr/op_less_equal.md | 4 +++- reference/memory/unique_ptr/op_not_equal.md | 2 ++ reference/memory/unique_ptr/reset.md | 6 +++++- 10 files changed, 34 insertions(+), 8 deletions(-) diff --git a/reference/memory/unique_ptr.md b/reference/memory/unique_ptr.md index 1658fe457a..41c0041950 100644 --- a/reference/memory/unique_ptr.md +++ b/reference/memory/unique_ptr.md @@ -153,5 +153,7 @@ 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) +- [LWG Issue 978. Hashing smart pointers](https://cplusplus.github.io/LWG/issue978) + - C++11で、[`hash`](/reference/functional/hash.md)クラスの特殊化が追加された。非順序連想コンテナのキーとしてスマートポインタを使えるようにするため - [LWG Issue 4144. Disallow `unique_ptr`](https://cplusplus.github.io/LWG/issue4144) - C++26で、`T*`が有効な型とならない特殊化(`unique_ptr`など)の実体化が不適格であることが明確化された diff --git a/reference/memory/unique_ptr/op_assign.md b/reference/memory/unique_ptr/op_assign.md index a929a807a2..0a21c37f53 100644 --- a/reference/memory/unique_ptr/op_assign.md +++ b/reference/memory/unique_ptr/op_assign.md @@ -121,12 +121,16 @@ int main() - 2012までは、delete宣言に対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 ## 参照 -- [LWG Issue 2047. Incorrect "mixed" move-assignment semantics of `unique_ptr`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2047) +- [LWG Issue 1021. Allow `nullptr_t` assignments to `unique_ptr`](https://cplusplus.github.io/LWG/issue1021) + - C++11で、代入演算子の引数型が未規定のポインタ型から`nullptr_t`へ改められた。`nullptr`を代入して解放する用途を、処理系ごとの実装技法に依存せず規定できるようにするため - [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ルール不足の欠陥修正の提案文書 +- [LWG Issue 1303. `shared_ptr`, `unique_ptr`, and rvalue references v2](https://cplusplus.github.io/LWG/issue1303) + - C++11で、変換可能な型からのコピー代入演算子の`delete`宣言が削除された。テンプレートの代入演算子はコピー代入演算子にならないため、宣言する必要がなかった +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) +- [LWG Issue 2047. Incorrect "mixed" move-assignment semantics of `unique_ptr`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2047) - [LWG Issue 2899. `is_(nothrow_)move_constructible` and `tuple`, `optional` and `unique_ptr`](https://cplusplus.github.io/LWG/issue2899) - C++20で、ムーブ代入演算子(1)が、デリータ型`D`がムーブ代入可能でない場合はオーバーロード解決に参加しないよう制約化された -- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) - [LWG Issue 3455. Incorrect Postconditions on `unique_ptr` move assignment](https://cplusplus.github.io/LWG/issue3455) - C++23で、ムーブ代入の事後条件が自己ムーブ代入を考慮するよう修正された(`this != addressof(u)`のときのみ`u.get() == nullptr`となる)。これは誤っていた事後条件の文言を修正したものであり、効果`reset(u.release())`による実際の挙動(自己ムーブ代入では`u`が変化しない)はC++11から一貫して同じであるため、本文の事後条件はバージョンによらずこの記述となる diff --git a/reference/memory/unique_ptr/op_constructor.md b/reference/memory/unique_ptr/op_constructor.md index bb89acf383..5dbe5c1bd3 100644 --- a/reference/memory/unique_ptr/op_constructor.md +++ b/reference/memory/unique_ptr/op_constructor.md @@ -208,12 +208,16 @@ int main() - [N4190 Removing `auto_ptr`, `random_shuffle()`, And Old `` Stuff](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4190.htm) - [N4089 Safe conversions in `unique_ptr`, revision 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4089.pdf) - [LWG Issue 2520 : N4089 broke initializing `unique_ptr` from a nullptr](https://wg21.cmeerw.net/lwg/issue2520) +- [LWG Issue 1303. `shared_ptr`, `unique_ptr`, and rvalue references v2](https://cplusplus.github.io/LWG/issue1303) + - C++11で、変換可能な型からのコピーコンストラクタ・コピー代入演算子の`delete`宣言が削除された。テンプレートのコンストラクタはコピーコンストラクタにならないため、宣言する必要がなかった +- [LWG Issue 1402. `nullptr` constructors for smart pointers should be `constexpr`](https://cplusplus.github.io/LWG/issue1402) + - C++11で、[`nullptr`](/reference/cstddef/nullptr_t.md)からのコンストラクタに`constexpr`が付加された。デフォルトコンストラクタと同様に、静的初期化できるようにするため - [LWG Issue 2801. Default-constructibility of `unique_ptr`](https://wg21.cmeerw.net/lwg/issue2948) - [LWG Issue 2899. `is_(nothrow_)move_constructible` and `tuple`, `optional` and `unique_ptr`](https://cplusplus.github.io/LWG/issue2899) - C++20で、ムーブコンストラクタ(5)が、デリータ型`D`がムーブ構築可能でない場合はオーバーロード解決に参加しないよう制約化され、`is_move_constructible>`が正しく判定されるようになった +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) - [LWG Issue 2905. `is_constructible_v, P, D const &>` should be false when D is not copy constructible](https://wg21.cmeerw.net/lwg/issue2905) - [LWG Issue 2944. LWG 2905 accidentally removed requirement that construction of the deleter doesn't throw an exception](https://cplusplus.github.io/LWG/issue2944) - C++20で、LWG 2905の文言簡略化で失われた「デリータの構築が例外を送出しない」要件が復元された。この修正は欠陥報告(DR)であり、C++17にも遡及して適用される -- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) - [LWG Issue 3632. `unique_ptr` "_Mandates_: This constructor is not selected by class template argument deduction"](https://cplusplus.github.io/LWG/issue3632) - C++23で、クラステンプレート実引数推論(CTAD)による選択を防ぐ仕様が、Mandates指定から引数型を`type_identity_t`とする方式へ書き換えられた(観測可能な振る舞いは変わらない) diff --git a/reference/memory/unique_ptr/op_equal.md b/reference/memory/unique_ptr/op_equal.md index a44149466d..dea9584fcd 100644 --- a/reference/memory/unique_ptr/op_equal.md +++ b/reference/memory/unique_ptr/op_equal.md @@ -84,3 +84,5 @@ 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) +- [LWG Issue 1401. Provide support for `unique_ptr` == `nullptr`](https://cplusplus.github.io/LWG/issue1401) + - C++11で、[`nullptr`](/reference/cstddef/nullptr_t.md)と比較するオーバーロードが追加された。`unique_ptr`同士を比較するオーバーロードは両辺のテンプレート引数を推論するため、`nullptr`を渡しても`unique_ptr`として推論されず、比較できなかった diff --git a/reference/memory/unique_ptr/op_greater.md b/reference/memory/unique_ptr/op_greater.md index f1a5f863fb..c52c04c281 100644 --- a/reference/memory/unique_ptr/op_greater.md +++ b/reference/memory/unique_ptr/op_greater.md @@ -85,4 +85,6 @@ 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 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) +- [LWG Issue 1401. Provide support for `unique_ptr` == `nullptr`](https://cplusplus.github.io/LWG/issue1401) + - C++11で、[`nullptr`](/reference/cstddef/nullptr_t.md)と比較するオーバーロードが追加された。`unique_ptr`同士を比較するオーバーロードは両辺のテンプレート引数を推論するため、`nullptr`を渡しても`unique_ptr`として推論されず、比較できなかった diff --git a/reference/memory/unique_ptr/op_greater_equal.md b/reference/memory/unique_ptr/op_greater_equal.md index 48306df50e..aba864fcee 100644 --- a/reference/memory/unique_ptr/op_greater_equal.md +++ b/reference/memory/unique_ptr/op_greater_equal.md @@ -85,4 +85,6 @@ 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 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) +- [LWG Issue 1401. Provide support for `unique_ptr` == `nullptr`](https://cplusplus.github.io/LWG/issue1401) + - C++11で、[`nullptr`](/reference/cstddef/nullptr_t.md)と比較するオーバーロードが追加された。`unique_ptr`同士を比較するオーバーロードは両辺のテンプレート引数を推論するため、`nullptr`を渡しても`unique_ptr`として推論されず、比較できなかった diff --git a/reference/memory/unique_ptr/op_less.md b/reference/memory/unique_ptr/op_less.md index fb67e059c5..c338db8b32 100644 --- a/reference/memory/unique_ptr/op_less.md +++ b/reference/memory/unique_ptr/op_less.md @@ -87,4 +87,6 @@ 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 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) +- [LWG Issue 1401. Provide support for `unique_ptr` == `nullptr`](https://cplusplus.github.io/LWG/issue1401) + - C++11で、[`nullptr`](/reference/cstddef/nullptr_t.md)と比較するオーバーロードが追加された。`unique_ptr`同士を比較するオーバーロードは両辺のテンプレート引数を推論するため、`nullptr`を渡しても`unique_ptr`として推論されず、比較できなかった diff --git a/reference/memory/unique_ptr/op_less_equal.md b/reference/memory/unique_ptr/op_less_equal.md index 2e63dba6b1..a60c9bf41c 100644 --- a/reference/memory/unique_ptr/op_less_equal.md +++ b/reference/memory/unique_ptr/op_less_equal.md @@ -85,4 +85,6 @@ 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 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) +- [LWG Issue 1401. Provide support for `unique_ptr` == `nullptr`](https://cplusplus.github.io/LWG/issue1401) + - C++11で、[`nullptr`](/reference/cstddef/nullptr_t.md)と比較するオーバーロードが追加された。`unique_ptr`同士を比較するオーバーロードは両辺のテンプレート引数を推論するため、`nullptr`を渡しても`unique_ptr`として推論されず、比較できなかった diff --git a/reference/memory/unique_ptr/op_not_equal.md b/reference/memory/unique_ptr/op_not_equal.md index 053a3ade20..0867c55858 100644 --- a/reference/memory/unique_ptr/op_not_equal.md +++ b/reference/memory/unique_ptr/op_not_equal.md @@ -80,3 +80,5 @@ 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) +- [LWG Issue 1401. Provide support for `unique_ptr` == `nullptr`](https://cplusplus.github.io/LWG/issue1401) + - C++11で、[`nullptr`](/reference/cstddef/nullptr_t.md)と比較するオーバーロードが追加された。`unique_ptr`同士を比較するオーバーロードは両辺のテンプレート引数を推論するため、`nullptr`を渡しても`unique_ptr`として推論されず、比較できなかった diff --git a/reference/memory/unique_ptr/reset.md b/reference/memory/unique_ptr/reset.md index d8e0422294..25ad12b47f 100644 --- a/reference/memory/unique_ptr/reset.md +++ b/reference/memory/unique_ptr/reset.md @@ -82,6 +82,10 @@ 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) +- [LWG Issue 821. Minor cleanup : `unique_ptr`](https://cplusplus.github.io/LWG/issue821) + - C++11で、配列版に`nullptr_t`を受け取るオーバーロード(2)と、`delete`定義されたテンプレート版(3)が追加された。配列版では派生クラスのポインタを受け取ると要素サイズの不一致で誤った`delete[]`が行われるため、`pointer`に変換可能な他のポインタ型を受け付けないようにしたもの - [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) +- [LWG Issue 998. Smart pointer referencing its owner](https://cplusplus.github.io/LWG/issue998) + - C++11で、効果が「まず`p`を格納ポインタへ代入し、その後で古いポインタに対して削除子を呼び出す」という順序で規定された。逆順だと、削除対象のオブジェクトが所有者である`unique_ptr`を参照している場合に、破棄途中の状態を観測できてしまうため +- [LWG Issue 2169. Missing `reset()` requirements in `unique_ptr` specialization](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2169) From 5f0e6d3e2e5e6b69c581803879deb398938e32db Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:29:27 +0900 Subject: [PATCH 091/147] =?UTF-8?q?addressof=20:=20=E6=BC=94=E7=AE=97?= =?UTF-8?q?=E5=AD=90=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=81=8C=E4=BD=BF=E3=82=8F=E3=82=8C=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=81=93=E3=81=A8=E3=81=8C=E6=98=8E=E8=A8=98=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/addressof.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reference/memory/addressof.md b/reference/memory/addressof.md index 0f06e0e477..8ca53f533d 100644 --- a/reference/memory/addressof.md +++ b/reference/memory/addressof.md @@ -26,7 +26,7 @@ namespace std { ## 戻り値 -変数`r`のアドレスを返す。 +`r`が参照するオブジェクトまたは関数の実際のアドレスを返す。`operator&()`がオーバーロードされている場合でも、そのオーバーロードは使用されない。 ## 例外 @@ -83,5 +83,9 @@ int main() ## 参照 - [`boost::addressof()` - Boost C++ Libraries](http://www.boost.org/doc/libs/release/libs/utility/utility.htm#addressof) +- [LWG Issue 970. `addressof` overload unneeded](https://cplusplus.github.io/LWG/issue970) + - C++11で、右辺値参照を受け取るオーバーロードが削除された。一時オブジェクトのアドレスを取得する用途がないため +- [LWG Issue 999. Taking the address of a function](https://cplusplus.github.io/LWG/issue999) + - C++11で、関数のアドレスも取得できることが明記された - [LWG Issue 2296. `std::addressof` should be `constexpr`](https://wg21.cmeerw.net/lwg/issue2296) - [LWG Issue 2598. `addressof` works on temporaries](https://wg21.cmeerw.net/lwg/issue2598) From ae2fdae87d5437054e841295c8ca2754df0f0b16 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:29:53 +0900 Subject: [PATCH 092/147] =?UTF-8?q?allocator=20:=20LWG=20Issue=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/allocator.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/memory/allocator.md b/reference/memory/allocator.md index a3c9b76b48..982969d91a 100644 --- a/reference/memory/allocator.md +++ b/reference/memory/allocator.md @@ -143,7 +143,9 @@ 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++23で`is_always_equal`メンバ型が非推奨化された +- [LWG Issue 752. Allocator complexity requirement](https://cplusplus.github.io/LWG/issue752) + - C++11で、「アロケータのすべての操作は償却定数時間であることが期待される」という要件が削除された。`allocate`や`deallocate`は本質的に定数時間で実装できるとは限らず、満たせない要件だったため - [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`メンバ型が削除された +- [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++23で`is_always_equal`メンバ型が非推奨化された From 0acb5d7378f2ea389bbfc201919a68abe16d13d6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:30:11 +0900 Subject: [PATCH 093/147] =?UTF-8?q?allocator=5Farg=5Ft=20:=20LWG=20Issue?= =?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/memory/allocator_arg_t.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/memory/allocator_arg_t.md b/reference/memory/allocator_arg_t.md index 938866764b..dee9cbfd46 100644 --- a/reference/memory/allocator_arg_t.md +++ b/reference/memory/allocator_arg_t.md @@ -38,5 +38,9 @@ namespace std { ## 参照 +- [LWG Issue 1073. Declaration of `allocator_arg` should be `constexpr`](https://cplusplus.github.io/LWG/issue1073) + - C++11で、`allocator_arg`の宣言が`const`から`constexpr`へ改められた +- [LWG Issue 1403. Inconsistent definitions for `allocator_arg`](https://cplusplus.github.io/LWG/issue1403) + - C++11で、ヘッダの概要とクラスの規定とで`allocator_arg`の宣言が食い違っていた問題が解消され、どちらも`constexpr`に統一された - [LWG Issue 2510. Tag types should not be `DefaultConstructible`](https://cplusplus.github.io/LWG/issue2510) - C++17で、`{}`による暗黙構築を防ぐため、明示的なデフォルトコンストラクタ(`explicit allocator_arg_t() = default;`)が追加された From c024dc80c7511282e3bf7fa63fd340d564b9952c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:30:38 +0900 Subject: [PATCH 094/147] =?UTF-8?q?declare=5Fno=5Fpointers=20:=20LWG=20Iss?= =?UTF-8?q?ue=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/declare_no_pointers.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/memory/declare_no_pointers.md b/reference/memory/declare_no_pointers.md index c7c89ef3b9..f993c5fd3d 100644 --- a/reference/memory/declare_no_pointers.md +++ b/reference/memory/declare_no_pointers.md @@ -114,3 +114,5 @@ int main() ## 参照 - [P2186R2 Removing Garbage Collection Support](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2186r2.html) +- [LWG Issue 1408. Allow recycling of pointers after `undeclare_no_pointers`](https://cplusplus.github.io/LWG/issue1408) + - C++11で、要件が「以前に登録されていないこと」から「現在登録されていないこと」へ改められた。[`undeclare_no_pointers()`](undeclare_no_pointers.md)で登録を解除した範囲を再登録できるようにするため From 6b8fe2e427f675624448f8256cddb1418951e82e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:39:30 +0900 Subject: [PATCH 095/147] =?UTF-8?q?default=5Fdelete=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=81=AE=E5=80=8B=E5=88=A5?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92=E4=BD=9C=E6=88=90=E3=81=97?= =?UTF-8?q?=E3=80=81=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E6=9B=B8?= =?UTF-8?q?=E3=81=8D=E5=88=86=E3=81=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/default_delete.md | 25 ++-- reference/memory/default_delete/op_call.md | 105 +++++++++++++++++ .../memory/default_delete/op_constructor.md | 107 ++++++++++++++++++ 3 files changed, 227 insertions(+), 10 deletions(-) create mode 100644 reference/memory/default_delete/op_call.md create mode 100644 reference/memory/default_delete/op_constructor.md diff --git a/reference/memory/default_delete.md b/reference/memory/default_delete.md index daa4caa748..d56fc87603 100644 --- a/reference/memory/default_delete.md +++ b/reference/memory/default_delete.md @@ -19,28 +19,25 @@ namespace std { ## 概要 `default_delete`は、リソースを自動的に解放するスマートポインタクラスである[`unique_ptr`](/reference/memory/unique_ptr.md)において、デフォルトで使用されるデリータクラスである。[`unique_ptr`](/reference/memory/unique_ptr.md)が配列を所有できるようにするため、`T[]`時には`delete[]`を呼びだすように特殊化される。 -型`T`が不完全型である場合、`operator()`の実行は不適格となる。 +テンプレートパラメータ`T`には不完全型を指定してよい。ただし、型`T`が不完全型である場合、`operator()`の実行は不適格となる。 ## 単一オブジェクト版のメンバ関数 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `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
C++23からconstexpr指定 | +| [`(constructor)`](default_delete/op_constructor.md) | コンストラクタ | C++11 | +| [`operator()`](default_delete/op_call.md) | 渡されたポインタを`delete`で削除する | C++11 | ## 配列版のメンバ関数 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `constexpr default_delete() noexcept=default;` | デフォルトコンストラクタ。 | C++11| -| `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
C++23からconstexpr指定 | +| [`(constructor)`](default_delete/op_constructor.md) | コンストラクタ | C++11 | +| [`operator()`](default_delete/op_call.md) | 渡されたポインタを`delete[]`で削除する | C++11 | + +デストラクタは宣言されておらず、暗黙に定義される。 ## 例 @@ -83,5 +80,13 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] +## 関連項目 +- [`unique_ptr`](unique_ptr.md) + + ## 参照 +- [LWG Issue 1193. `default_delete` cannot be instantiated with incomplete types](https://cplusplus.github.io/LWG/issue1193) + - C++11で、テンプレートパラメータ`T`が不完全型であってもよいことが明記された。不完全型を扱う[`unique_ptr`](unique_ptr.md)を宣言できるようにするため +- [N4089 Safe conversions in `unique_ptr`, revision 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4089.pdf) + - C++17で、配列版に変換コンストラクタが追加され、関数呼び出し演算子が制約付きのテンプレートへ置き換えられた - [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/default_delete/op_call.md b/reference/memory/default_delete/op_call.md new file mode 100644 index 0000000000..48baeb058f --- /dev/null +++ b/reference/memory/default_delete/op_call.md @@ -0,0 +1,105 @@ +# operator() +* memory[meta header] +* std[meta namespace] +* default_delete[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +// 単一オブジェクト版 +void operator()(T* ptr) const; // (1) C++11 +constexpr void operator()(T* ptr) const; // (1) C++23 + +// 配列版 (default_delete) +void operator()(T* ptr) const; // (2) C++11 + // C++14まで +template +void operator()(U* ptr) const = delete; // (3) C++11 + // C++14まで + +template +void operator()(U* ptr) const; // (4) C++17 +template +constexpr void operator()(U* ptr) const; // (4) C++23 +``` + +## 概要 +渡されたポインタが指すオブジェクトを削除する。 + +- (1) : `delete`によって単一オブジェクトを削除する +- (2), (4) : `delete[]`によって配列を削除する +- (3) : `T*`以外のポインタを受け取らないようにするための、`delete`定義されたオーバーロード + + +## テンプレートパラメータ制約 +- (4) : `U(*)[]`が`T(*)[]`に変換可能であること。満たさない場合はオーバーロード解決に参加しない + + +## 適格要件 +- (1), (2) : 型`T`が完全型であること +- (4) : 型`U`が完全型であること + + +## 効果 +- (1) : `delete ptr;`を呼び出す +- (2), (4) : `delete[] ptr;`を呼び出す + + +## 戻り値 +なし + + +## 備考 +- (3) : 配列版に`T*`へ暗黙変換できる派生クラスのポインタを渡せてしまうと、要素サイズの不一致により`delete[]`が誤った動作をする。これを防ぐため、`T*`以外を受け取るオーバーロードが`delete`定義されていた。 +- (4) : C++17で(2)と(3)がこのオーバーロードに置き換えられた。`U(*)[]`から`T(*)[]`への変換 (`int[]`から`const int[]`への変換など) が可能な場合に限って呼び出せるため、`delete`定義されたオーバーロードを別途用意する必要がなくなった。 + + +## 例 +```cpp example +#include +#include + +struct X { + ~X() { std::cout << "~X()" << std::endl; } +}; + +int main() +{ + // (1) 単一オブジェクトの削除 + std::default_delete d1; + d1(new X()); + + // (2), (4) 配列の削除 + std::default_delete d2; + d2(new X[2]); +} +``` +* std::default_delete[color ff0000] + +### 出力 +``` +~X() +~X() +~X() +``` + + +## バージョン +### 言語 +- C++11 + + +## 関連項目 +- [`default_delete::(constructor)`](op_constructor.md) +- [`unique_ptr`](../unique_ptr.md) + + +## 参照 +- [LWG Issue 938. `default_delete::operator()` should only accept `T*`](https://cplusplus.github.io/LWG/issue938) + - C++11で、配列版に、`T*`以外のポインタを受け取る(3)のオーバーロードが`delete`指定で追加された +- [LWG Issue 1193. `default_delete` cannot be instantiated with incomplete types](https://cplusplus.github.io/LWG/issue1193) + - C++11で、クラステンプレート自体は不完全型で実体化してよく、この関数の実行時に完全型であることが要求されると整理された +- [N4089 Safe conversions in `unique_ptr`, revision 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4089.pdf) + - C++17で、配列版の(2)と(3)が、制約付きのテンプレートである(4)へ置き換えられた +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) + - C++23で、この関数が`constexpr`対応した diff --git a/reference/memory/default_delete/op_constructor.md b/reference/memory/default_delete/op_constructor.md new file mode 100644 index 0000000000..eaafc0a388 --- /dev/null +++ b/reference/memory/default_delete/op_constructor.md @@ -0,0 +1,107 @@ +# コンストラクタ +* memory[meta header] +* std[meta namespace] +* default_delete[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +// 単一オブジェクト版 +constexpr default_delete() noexcept = default; // (1) C++11 + +template +default_delete(const default_delete& other) noexcept; // (2) C++11 +template +constexpr default_delete(const default_delete& other) noexcept; // (2) C++23 + +// 配列版 (default_delete) +constexpr default_delete() noexcept = default; // (3) C++11 + +template +default_delete(const default_delete& other) noexcept; // (4) C++17 +template +constexpr default_delete(const default_delete& other) noexcept; // (4) C++23 +``` + +## 概要 +`default_delete`オブジェクトを構築する。 + +- (1), (3) : デフォルトコンストラクタ +- (2), (4) : 変換可能な型の`default_delete`オブジェクトから構築する + + +## テンプレートパラメータ制約 +- (2) : `U*`が`T*`に暗黙変換可能であること +- (4) : `U(*)[]`が`T(*)[]`に変換可能であること + +いずれも、満たさない場合はオーバーロード解決に参加しない。 + + +## 効果 +- (1), (3) : 何もしない +- (2), (4) : `other`から`default_delete`オブジェクトを構築する + + +## 例外 +投げない + + +## 備考 +- (1), (3) : `= default`で定義されるため、トリビアルなデフォルトコンストラクタである。 +- (4) : 配列版の変換コンストラクタは、C++17で追加された。それ以前は、`default_delete`から`default_delete`のような変換ができなかった。 + + +## 例 +```cpp example +#include + +struct Base {}; +struct Derived : Base {}; + +int main() +{ + // (1) デフォルト構築 + std::default_delete d1; + + // (2) 変換可能な型からの構築 + // Derived*はBase*に暗黙変換可能 + std::default_delete d2 = d1; + + // (3) 配列版のデフォルト構築 + std::default_delete d3; + + // (4) 配列版の変換可能な型からの構築 + // const修飾を付加する変換は可能 + std::default_delete d4; + std::default_delete d5 = d4; + + Derived* p = new Derived(); + d2(p); +} +``` +* std::default_delete[color ff0000] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++11 + + +## 関連項目 +- [`default_delete::operator()`](op_call.md) +- [`unique_ptr`](../unique_ptr.md) + + +## 参照 +- [LWG Issue 854. `default_delete` converting constructor underspecified](https://cplusplus.github.io/LWG/issue854) + - C++11で、(2)が`U*`から`T*`へ暗黙変換可能な場合にのみオーバーロード解決に参加することが規定された +- [LWG Issue 1517. `default_delete`'s default constructor should be trivial](https://cplusplus.github.io/LWG/issue1517) + - C++11で、デフォルトコンストラクタが`= default`で定義されるようになり、トリビアルになった +- [N4089 Safe conversions in `unique_ptr`, revision 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4089.pdf) + - C++17で、配列版に変換コンストラクタ(4)が追加された +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) + - C++23で、コンストラクタが`constexpr`対応した From c600bc5f80544100a8e40af0b44cbd9abe0bc2fc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:52:30 +0900 Subject: [PATCH 096/147] =?UTF-8?q?get=5Fpointer=5Fsafety=20:=20=E4=BE=8B?= =?UTF-8?q?=E5=A4=96=E3=82=92=E6=8A=95=E3=81=92=E3=81=AA=E3=81=84=E3=81=93?= =?UTF-8?q?=E3=81=A8=E3=81=8C=E8=A6=8F=E5=AE=9A=E3=81=95=E3=82=8C=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=81=A8=E3=80=81=E6=88=BB=E3=82=8A=E5=80=A4=E3=82=92?= =?UTF-8?q?=E3=82=88=E3=82=8A=E6=98=8E=E7=A2=BA=E3=81=AB=E6=9B=B8=E3=81=84?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/get_pointer_safety.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/reference/memory/get_pointer_safety.md b/reference/memory/get_pointer_safety.md index 05ac5e1c43..9d6a1fb05d 100644 --- a/reference/memory/get_pointer_safety.md +++ b/reference/memory/get_pointer_safety.md @@ -19,9 +19,13 @@ namespace std { ## 戻り値 -[`pointer_safety`](/reference/memory/pointer_safety.md)型の列挙値のうち、いずれかが返却される。 +処理系が厳密なポインタ安全性を持つ場合、[`pointer_safety::strict`](/reference/memory/pointer_safety.md)を返す。 -返される値は処理系依存。 +処理系が緩やかなポインタ安全性を持つ場合、[`pointer_safety::relaxed`](/reference/memory/pointer_safety.md)と[`pointer_safety::preferred`](/reference/memory/pointer_safety.md)のどちらを返すかは処理系定義である。 + + +## 例外 +投げない ## バージョン @@ -37,3 +41,5 @@ namespace std { ## 参照 - [P2186R2 Removing Garbage Collection Support](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2186r2.html) +- [LWG Issue 1098. definition of `get_pointer_safety()`](https://cplusplus.github.io/LWG/issue1098) + - C++11で、戻り値が処理系のポインタ安全性に基づいて規定され、例外を送出しないことが明記された From 3b05d412f4bebdae4ea92461c0492a2d22c48297 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:52:45 +0900 Subject: [PATCH 097/147] =?UTF-8?q?make=5Fshared=20:=20LWG=20Issue?= =?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/memory/make_shared.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/memory/make_shared.md b/reference/memory/make_shared.md index 8e7b208703..b5f726dd09 100644 --- a/reference/memory/make_shared.md +++ b/reference/memory/make_shared.md @@ -145,6 +145,8 @@ int main() { - [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) +- [LWG Issue 866. Qualification of placement new-expressions](https://cplusplus.github.io/LWG/issue866) + - C++11で、`make_shared`が要素を構築する際に使用する配置`new`が`::new`と修飾された。修飾がないと、要素型がクラススコープの`operator new`をオーバーロードしている場合にそちらが選ばれてしまい、対応する`operator delete`が呼ばれず不整合を起こすため - [LWG Issue 2696. Interaction between `make_shared` and `enable_shared_from_this` is underspecified](https://cplusplus.github.io/LWG/issue2696) - C++17で、`make_shared`/`allocate_shared`が呼び出すコンストラクタも`shared_from_this`を有効にすることが明確化された - この修正は欠陥報告(DR)であり、C++11以降に遡及して適用される。元の規定はpublicなコンストラクタについてのみ`shared_from_this`の有効化を述べており、これらの関数が使う非publicなコンストラクタについては未規定だったが、処理系は当初から有効化していたため From fb75eb135a120b7498c77778d6de41b140123181 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:53:08 +0900 Subject: [PATCH 098/147] =?UTF-8?q?owner=5Fless=20:=20LWG=20Issue=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/owner_less.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/memory/owner_less.md b/reference/memory/owner_less.md index c7e5f05d4e..d580eb9a63 100644 --- a/reference/memory/owner_less.md +++ b/reference/memory/owner_less.md @@ -183,3 +183,5 @@ false - [N2637 Revisiting `std::shared_ptr` comparison](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2637.pdf) - [P0074R0 Making `std::owner_less` more flexible](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0074r0.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) +- [LWG Issue 949. `owner_less`](https://cplusplus.github.io/LWG/issue949) + - C++11で、関数呼び出し演算子の戻り値が`x.before(y)`から`x.owner_before(y)`へ修正された。`before`というメンバ関数は存在せず、意図していたのは所有権ベースの比較だったため From 0875131b5ae35700f7dbd076440a284be93106f5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:53:25 +0900 Subject: [PATCH 099/147] =?UTF-8?q?uninitialized=E7=B3=BB=20:=20LWG=20Issu?= =?UTF-8?q?e=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/uninitialized_copy.md | 6 ++++-- reference/memory/uninitialized_copy_n.md | 6 ++++-- reference/memory/uninitialized_fill.md | 2 ++ reference/memory/uninitialized_fill_n.md | 4 ++++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/reference/memory/uninitialized_copy.md b/reference/memory/uninitialized_copy.md index 71de7f11ca..98afcda600 100644 --- a/reference/memory/uninitialized_copy.md +++ b/reference/memory/uninitialized_copy.md @@ -113,7 +113,9 @@ int main() ## 参照 - [LWG Issue 2433 `uninitialized_copy()`/etc. should tolerate overloaded `operator&`](https://wg21.cmeerw.net/lwg/issue2433) -- [LWG Issue 3054. `uninitialized_copy` appears to not be able to meet its exception-safety guarantee](https://cplusplus.github.io/LWG/issue3054) - - C++20で、例外送出時に「効果なし」とする達成不能な保証が撤廃され、構築済みのオブジェクトを未規定の順序で破棄してから例外を伝播すると明確化された +- [LWG Issue 866. Qualification of placement new-expressions](https://cplusplus.github.io/LWG/issue866) + - C++11で、`uninitialized_copy`が要素を構築する際に使用する配置`new`が`::new`と修飾された。修飾がないと、要素型がクラススコープの`operator new`をオーバーロードしている場合にそちらが選ばれてしまい、対応する`operator delete`が呼ばれず不整合を起こすため - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた +- [LWG Issue 3054. `uninitialized_copy` appears to not be able to meet its exception-safety guarantee](https://cplusplus.github.io/LWG/issue3054) + - C++20で、例外送出時に「効果なし」とする達成不能な保証が撤廃され、構築済みのオブジェクトを未規定の順序で破棄してから例外を伝播すると明確化された diff --git a/reference/memory/uninitialized_copy_n.md b/reference/memory/uninitialized_copy_n.md index d1ebfa7de6..ac317fd123 100644 --- a/reference/memory/uninitialized_copy_n.md +++ b/reference/memory/uninitialized_copy_n.md @@ -131,7 +131,9 @@ 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) -- [LWG Issue 3054. `uninitialized_copy` appears to not be able to meet its exception-safety guarantee](https://cplusplus.github.io/LWG/issue3054) - - C++20で、例外送出時に「効果なし」とする達成不能な保証が撤廃され、構築済みのオブジェクトを未規定の順序で破棄してから例外を伝播すると明確化された +- [LWG Issue 866. Qualification of placement new-expressions](https://cplusplus.github.io/LWG/issue866) + - C++11で、`uninitialized_copy_n`が要素を構築する際に使用する配置`new`が`::new`と修飾された。修飾がないと、要素型がクラススコープの`operator new`をオーバーロードしている場合にそちらが選ばれてしまい、対応する`operator delete`が呼ばれず不整合を起こすため - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた +- [LWG Issue 3054. `uninitialized_copy` appears to not be able to meet its exception-safety guarantee](https://cplusplus.github.io/LWG/issue3054) + - C++20で、例外送出時に「効果なし」とする達成不能な保証が撤廃され、構築済みのオブジェクトを未規定の順序で破棄してから例外を伝播すると明確化された diff --git a/reference/memory/uninitialized_fill.md b/reference/memory/uninitialized_fill.md index 37bf9c3298..5d22f6dab5 100644 --- a/reference/memory/uninitialized_fill.md +++ b/reference/memory/uninitialized_fill.md @@ -169,3 +169,5 @@ int main() - C++26から`constexpr`がついた - [P3787R2 Adjoints to "Enabling list-initialization for algorithms": uninitialized_fill](https://open-std.org/jtc1/sc22/wg21/docs/papers/2026/p3787r2.html) - C++26で値型をイテレータから推論するよう拡張され、波カッコ初期化を直接渡せるようになった +- [LWG Issue 866. Qualification of placement new-expressions](https://cplusplus.github.io/LWG/issue866) + - C++11で、`uninitialized_fill`が要素を構築する際に使用する配置`new`が`::new`と修飾された。修飾がないと、要素型がクラススコープの`operator new`をオーバーロードしている場合にそちらが選ばれてしまい、対応する`operator delete`が呼ばれず不整合を起こすため diff --git a/reference/memory/uninitialized_fill_n.md b/reference/memory/uninitialized_fill_n.md index a9847699db..e94323aac6 100644 --- a/reference/memory/uninitialized_fill_n.md +++ b/reference/memory/uninitialized_fill_n.md @@ -171,3 +171,7 @@ int main() - C++26から`constexpr`がついた - [P3787R2 Adjoints to "Enabling list-initialization for algorithms": uninitialized_fill](https://open-std.org/jtc1/sc22/wg21/docs/papers/2026/p3787r2.html) - C++26で値型をイテレータから推論するよう拡張され、波カッコ初期化を直接渡せるようになった +- [LWG Issue 866. Qualification of placement new-expressions](https://cplusplus.github.io/LWG/issue866) + - C++11で、`uninitialized_fill_n`が要素を構築する際に使用する配置`new`が`::new`と修飾された。修飾がないと、要素型がクラススコープの`operator new`をオーバーロードしている場合にそちらが選ばれてしまい、対応する`operator delete`が呼ばれず不整合を起こすため +- [LWG Issue 1339. `uninitialized_fill_n` should return the end of its range](https://cplusplus.github.io/LWG/issue1339) + - C++11で、戻り値の型が`void`から`ForwardIterator`へ改められ、書き込んだ範囲の終端を返すようになった From 0a37365ccb8877548f019344412865e389ef81e6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:53:35 +0900 Subject: [PATCH 100/147] =?UTF-8?q?weak=5Fptr=20=20:=20LWG=20Issue?= =?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/memory/weak_ptr.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/memory/weak_ptr.md b/reference/memory/weak_ptr.md index 476eab7935..eb8ce548a7 100644 --- a/reference/memory/weak_ptr.md +++ b/reference/memory/weak_ptr.md @@ -114,5 +114,9 @@ shared_ptr managed object deleted. - [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 +- [LWG Issue 1231. `weak_ptr` comparisons incompletely resolved](https://cplusplus.github.io/LWG/issue1231) + - C++11で、`operator<`が削除され、このクラスに要求される要件から`LessThanComparable`が削除された +- [LWG Issue 1256. `weak_ptr` comparison functions should be removed](https://cplusplus.github.io/LWG/issue1256) + - C++11で、`delete`定義されていた比較演算子のメンバ宣言が削除された。演算子を`delete`定義しなくても、比較演算子が定義されていなければ比較できないため - [LWG Issue 3001. `weak_ptr::element_type` needs `remove_extent_t`](https://cplusplus.github.io/LWG/issue3001) - C++20で、`shared_ptr`の配列対応に合わせて`element_type`が`remove_extent_t`となるよう修正された。この修正は欠陥報告(DR)であり、C++17にも遡及して適用される From 15a961e50ef2386794196027269a8ab1d0f2b7c7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:54:50 +0900 Subject: [PATCH 101/147] =?UTF-8?q?mutex::lock=20:=20=E3=83=87=E3=83=83?= =?UTF-8?q?=E3=83=89=E3=83=AD=E3=83=83=E3=82=AF=E3=81=AE=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E6=80=A7=E3=82=92=E6=A4=9C=E5=87=BA=E3=81=A7=E3=81=8D=E3=81=AA?= =?UTF-8?q?=E3=81=91=E3=82=8C=E3=81=B0=E4=BE=8B=E5=A4=96=E3=81=A7=E3=81=AF?= =?UTF-8?q?=E3=81=AA=E3=81=8F=E3=83=87=E3=83=83=E3=83=89=E3=83=AD=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=81=99=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C=E8=A8=98?= =?UTF-8?q?=E8=BC=89=E3=81=95=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mutex/mutex/lock.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/mutex/mutex/lock.md b/reference/mutex/mutex/lock.md index 00f7512ef9..9f01e4abff 100644 --- a/reference/mutex/mutex/lock.md +++ b/reference/mutex/mutex/lock.md @@ -33,6 +33,10 @@ void lock(); - C++14まで : [`device_or_resource_busy`](/reference/system_error/errc.md) : ミューテックスがすでにロックされていて、ブロッキングできない +## 備考 +- すでにミューテックスの所有権を保持しているスレッドがこの関数を呼び出した場合、処理系がデッドロックを検出すれば[`resource_deadlock_would_occur`](/reference/system_error/errc.md)が設定された例外が送出されるが、検出しなければデッドロックする。 + + ## 例 ```cpp example #include @@ -81,5 +85,7 @@ int main() ## 参照 +- [LWG Issue 893. `std::mutex` issue](https://cplusplus.github.io/LWG/issue893) + - C++11で、所有権を保持しているスレッドが再度この関数を呼び出した場合の動作は未定義であるという規定が削除され、デッドロックしうるという注記に改められた。あわせて[`resource_deadlock_would_occur`](/reference/system_error/errc.md)の条件が「処理系がデッドロックを検出した場合」に改められた - [LWG Issue 2309. `mutex::lock()` should not throw `device_or_resource_busy`](https://wg21.cmeerw.net/lwg/issue2309) - C++17以降、この関数から`device_or_resource_busy`が送出される可能性がなくなった。デッドロックが検出できればbusyではなく`resource_deadlock_would_occur`が送出されるべき。busyの検出は`mutex`クラスではなく[`condition_variable`](/reference/condition_variable/condition_variable.md)`::`[`wait()`](/reference/condition_variable/condition_variable/wait.md)で行うこと From 2a7cd2a65727d1cd0d207ff5dd598b763811b62b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 11:55:39 +0900 Subject: [PATCH 102/147] =?UTF-8?q?mutex::unlock=20:=20=E3=82=A2=E3=83=B3?= =?UTF-8?q?=E3=83=AD=E3=83=83=E3=82=AF=E5=BE=8C=E3=81=AB=E3=81=BB=E3=81=8B?= =?UTF-8?q?=E3=81=AE=E3=82=B9=E3=83=AC=E3=83=83=E3=83=89=E3=81=8C=E3=83=9F?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E3=83=86=E3=83=83=E3=82=AF=E3=82=B9=E3=81=AE?= =?UTF-8?q?=E5=B1=A5=E3=81=8D=E7=8A=B6=E6=B3=81=E3=82=92=E6=AD=A3=E3=81=97?= =?UTF-8?q?=E3=81=8F=E6=89=B1=E3=81=86=E3=81=93=E3=81=A8=E3=81=8C=E5=87=A6?= =?UTF-8?q?=E7=90=86=E7=B3=BB=E3=81=AE=E8=A6=81=E6=B1=82=E3=81=95=E3=82=8C?= =?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/mutex/mutex/unlock.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/mutex/mutex/unlock.md b/reference/mutex/mutex/unlock.md index 55dfcae8ba..e2fcdd3043 100644 --- a/reference/mutex/mutex/unlock.md +++ b/reference/mutex/mutex/unlock.md @@ -29,6 +29,10 @@ void unlock(); 投げない +## 備考 +- この関数からの復帰が完了する前に、ほかのスレッドが同じミューテックスをロック・アンロックして破棄することがありうる。処理系はこのような状況を正しく扱うことが要求されるため、この関数から戻ったあとにミューテックスへアクセスしなければ、そのような使い方をしても問題ない。 + + ## 例 ```cpp example #include @@ -77,3 +81,5 @@ int main() ## 参照 +- [LWG Issue 1218. `mutex` destructor synchronization](https://cplusplus.github.io/LWG/issue1218) + - C++11で、アンロック直後にほかのスレッドがミューテックスを破棄する状況を処理系が正しく扱うことが要求される旨の注記が追加された From ab3f9a816c5a7b1ac4456d29904d111dfc1013ed Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:10:58 +0900 Subject: [PATCH 103/147] =?UTF-8?q?unique=5Flock=20:=20LWG=20Issue?= =?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/mutex/unique_lock/lock.md | 2 ++ reference/mutex/unique_lock/op_constructor.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/reference/mutex/unique_lock/lock.md b/reference/mutex/unique_lock/lock.md index ee5e021a54..03c2536a90 100644 --- a/reference/mutex/unique_lock/lock.md +++ b/reference/mutex/unique_lock/lock.md @@ -89,3 +89,5 @@ int main() ## 参照 +- [LWG Issue 1159. Unclear spec for `resource_deadlock_would_occur`](https://cplusplus.github.io/LWG/issue1159) + - C++11で、送出される例外が個別に列挙され、`pm`がヌルポインタの場合は[`operation_not_permitted`](/reference/system_error/errc.md)、すでにロックを所有している場合は[`resource_deadlock_would_occur`](/reference/system_error/errc.md)となることが規定された diff --git a/reference/mutex/unique_lock/op_constructor.md b/reference/mutex/unique_lock/op_constructor.md index 273976799e..66d39f9869 100644 --- a/reference/mutex/unique_lock/op_constructor.md +++ b/reference/mutex/unique_lock/op_constructor.md @@ -143,3 +143,5 @@ int main() - 2012はコピーコンストラクタのdeleteに対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 ## 参照 +- [LWG Issue 1045. Remove unnecessary preconditions from `unique_lock` constructor](https://cplusplus.github.io/LWG/issue1045) + - C++11で、(3)の`defer_lock_t`をとるコンストラクタから「非再帰的なミューテックスの場合、呼び出し元スレッドがミューテックスを所有していないこと」という事前条件が削除された。このコンストラクタはロック操作を行わないため、所有状態に対する制約は不要である From bdd8255e77a6b7f8612d0a934dba133cbd00ac28 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:18:53 +0900 Subject: [PATCH 104/147] =?UTF-8?q?adopt=5Flock,=20defer=5Flock,=20try=5Ft?= =?UTF-8?q?o=5Flock=20:=20LWG=20Issue=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/mutex/adopt_lock.md | 2 ++ reference/mutex/defer_lock.md | 2 ++ reference/mutex/try_to_lock.md | 2 ++ 3 files changed, 6 insertions(+) diff --git a/reference/mutex/adopt_lock.md b/reference/mutex/adopt_lock.md index fd1cc5f49b..927a3f890d 100644 --- a/reference/mutex/adopt_lock.md +++ b/reference/mutex/adopt_lock.md @@ -57,4 +57,6 @@ int main() ## 参照 +- [LWG Issue 1044. Empty tag types should be `constexpr` literals](https://cplusplus.github.io/LWG/issue1044) + - C++11で、タグ型が空のクラスとして定義され、その値が`extern const`から`constexpr`へ改められた。定数式で使用でき、別途の定義を必要としないようにするため - [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 f159498bb7..90a66242ed 100644 --- a/reference/mutex/defer_lock.md +++ b/reference/mutex/defer_lock.md @@ -55,4 +55,6 @@ int main() ## 参照 +- [LWG Issue 1044. Empty tag types should be `constexpr` literals](https://cplusplus.github.io/LWG/issue1044) + - C++11で、タグ型が空のクラスとして定義され、その値が`extern const`から`constexpr`へ改められた。定数式で使用でき、別途の定義を必要としないようにするため - [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 cb02a97fa7..d10e824491 100644 --- a/reference/mutex/try_to_lock.md +++ b/reference/mutex/try_to_lock.md @@ -61,4 +61,6 @@ int main() ## 参照 +- [LWG Issue 1044. Empty tag types should be `constexpr` literals](https://cplusplus.github.io/LWG/issue1044) + - C++11で、タグ型が空のクラスとして定義され、その値が`extern const`から`constexpr`へ改められた。定数式で使用でき、別途の定義を必要としないようにするため - [LWG Issue 2510. Tag types should not be `DefaultConstructible`](https://cplusplus.github.io/LWG/issue2510) From 143202d56dcd9a39d24234904c5fe2aa98c4cbe2 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:19:15 +0900 Subject: [PATCH 105/147] =?UTF-8?q?call=5Fonce=20:=20=E3=83=91=E3=83=A9?= =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=82=BF=E3=82=92=E5=8F=B3=E8=BE=BA=E5=80=A4?= =?UTF-8?q?=E5=8F=82=E7=85=A7=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/mutex/call_once.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reference/mutex/call_once.md b/reference/mutex/call_once.md index 85ee245be2..d0c9c1162d 100644 --- a/reference/mutex/call_once.md +++ b/reference/mutex/call_once.md @@ -7,7 +7,7 @@ ```cpp namespace std { template - void call_once(once_flag& flag, Callable func, Args&&... args); + void call_once(once_flag& flag, Callable&& func, Args&&... args); // (1) C++11 } ``` * once_flag[link /reference/mutex/once_flag.md] @@ -88,5 +88,9 @@ initialize ## 参照 +- [LWG Issue 891. `std::thread`, `std::call_once` issue](https://cplusplus.github.io/LWG/issue891) + - C++11で、`func`を右辺値参照で受け取るようになり、要件がコピー構築可能からムーブ構築可能へ緩和された。また、実引数を`decay_copy`によってコピーすることが規定された +- [LWG Issue 1494. Term "are serialized" not defined](https://cplusplus.github.io/LWG/issue1494) + - C++11で、「直列化される」という規格上定義されていない用語が使われていた効果の記述が、有効な呼び出しの有無に基づく規定へ整理された - [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でこの例外仕様が削除された。 From f4370e9bce278812c0992984d52af1f845f8e537 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:19:37 +0900 Subject: [PATCH 106/147] =?UTF-8?q?mutex,=20try=5Flock=20:=20LWG=20Issue?= =?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/mutex/mutex.md | 6 ++++++ reference/mutex/try_lock.md | 2 ++ 2 files changed, 8 insertions(+) diff --git a/reference/mutex/mutex.md b/reference/mutex/mutex.md index 7ed69bb700..1f923ae7eb 100644 --- a/reference/mutex/mutex.md +++ b/reference/mutex/mutex.md @@ -94,3 +94,9 @@ int main() ## 参照 +- [LWG Issue 960. Various threading bugs #10](https://cplusplus.github.io/LWG/issue960) + - C++11で、ミューテックスのメンバ関数が報告するエラー条件について、報告する場合はこれらの条件に限られるという規定へ改められた。エラーを報告しない処理系も許容するため +- [LWG Issue 967. Various threading bugs #17](https://cplusplus.github.io/LWG/issue967) + - C++11で、ミューテックスのエラー条件から[`not_enough_memory`](/reference/system_error/errc.md)が削除された。記憶域の確保失敗は[`bad_alloc`](/reference/new/bad_alloc.md)として報告されるため +- [LWG Issue 1218. `mutex` destructor synchronization](https://cplusplus.github.io/LWG/issue1218) + - C++11で、アンロック直後にほかのスレッドがミューテックスを破棄する状況を処理系が正しく扱うことが要求される旨の注記が追加された diff --git a/reference/mutex/try_lock.md b/reference/mutex/try_lock.md index 2739bda6cc..bb60313314 100644 --- a/reference/mutex/try_lock.md +++ b/reference/mutex/try_lock.md @@ -112,5 +112,7 @@ 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) +- [LWG Issue 986. Generic `try_lock` contradiction](https://cplusplus.github.io/LWG/issue986) + - C++11で、いずれかの`try_lock()`が失敗した場合に、それ以降の`try_lock()`を呼び出さないことが明記された - [LWG Issue 3030. Who shall meet the requirements of `try_lock`?](https://cplusplus.github.io/LWG/issue3030) - C++20で、効果の記述で利用者要件を表す「shall」を誤用していた箇所が、動作の記述に修正された From ef10de086e3685513021e8a59634bcf24e5f5b76 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:25:07 +0900 Subject: [PATCH 107/147] =?UTF-8?q?new=5Fhandler=20:=20C++98,=20C++11,=20C?= =?UTF-8?q?++20=E3=81=AE=E4=BB=95=E6=A7=98=E3=82=92=E6=9B=B8=E3=81=8D?= =?UTF-8?q?=E5=88=86=E3=81=91=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/new/new_handler.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/reference/new/new_handler.md b/reference/new/new_handler.md index dc4e9a4f71..014304b2a9 100644 --- a/reference/new/new_handler.md +++ b/reference/new/new_handler.md @@ -5,7 +5,8 @@ ```cpp namespace std { - using new_handler = void(*)(); + typedef void (*new_handler)(); // C++98 + using new_handler = void (*)(); // C++20 } ``` @@ -16,9 +17,11 @@ namespace std { ハンドラの内部では、以下のいずれかを行う必要がある: -- 確保済みの領域を解放して`return`する +- 確保のために利用できる領域を増やして`return`する - [`bad_alloc`](bad_alloc.md)またはその派生の例外を送出する -- `return`により処理を返すことなく、プログラムの実行を直ちに終了させる(`quick_exit()`、`exit()`、`abort()`などを使用する) +- プログラムの実行を終了させる + - C++98 : [`abort()`](/reference/cstdlib/abort.md)もしくは[`exit()`](/reference/cstdlib/exit.md)を呼び出す + - C++11 : 呼び出し元へ戻ることなく、プログラムの実行を終了させる。[`abort()`](/reference/cstdlib/abort.md)や[`exit()`](/reference/cstdlib/exit.md)のほか、[`quick_exit()`](/reference/cstdlib/quick_exit.md)なども使用できる ## 例 @@ -58,3 +61,19 @@ 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. ``` + + +## バージョン +### 言語 +- C++98 + + +## 関連項目 +- [`set_new_handler`](set_new_handler.md) +- [`get_new_handler`](get_new_handler.md) +- [`bad_alloc`](bad_alloc.md) + + +## 参照 +- [LWG Issue 994. `quick_exit` should terminate well-defined](https://cplusplus.github.io/LWG/issue994) + - C++11で、`new_handler`に要求される動作が「`abort()`もしくは`exit()`を呼び出す」から「呼び出し元へ戻らずにプログラムの実行を終了する」へ改められた。[`quick_exit()`](/reference/cstdlib/quick_exit.md)など他の終了手段も許容するため From ca7c76ab34185f64d1cc09d2aa2346eb27c05e44 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:25:32 +0900 Subject: [PATCH 108/147] =?UTF-8?q?set=5Fnew=5Fhandler=20:=20=E4=BE=8B?= =?UTF-8?q?=E5=A4=96=E6=8C=87=E5=AE=9A=E3=82=92=E8=A8=80=E8=AA=9E=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=81=A7=E6=9B=B8=E3=81=8D?= =?UTF-8?q?=E5=88=86=E3=81=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/new/set_new_handler.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/new/set_new_handler.md b/reference/new/set_new_handler.md index da5b23bc75..a52fae1195 100644 --- a/reference/new/set_new_handler.md +++ b/reference/new/set_new_handler.md @@ -5,7 +5,8 @@ ```cpp namespace std { - new_handler set_new_handler(new_handler new_p) noexcept; + new_handler set_new_handler(new_handler new_p) throw(); // (1) C++98 + new_handler set_new_handler(new_handler new_p) noexcept; // (1) C++11 } ``` * new_handler[link new_handler.md] From 448cef779aa1dc236d5171f5dc4b8ebb0ac032bc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:26:09 +0900 Subject: [PATCH 109/147] =?UTF-8?q?delete=E6=BC=94=E7=AE=97=E5=AD=90=20:?= =?UTF-8?q?=20=E3=83=9D=E3=82=A4=E3=83=B3=E3=82=BF=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E6=80=A7=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E4=BA=8B=E5=89=8D?= =?UTF-8?q?=E6=9D=A1=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/new/op_delete.md | 8 ++++++++ reference/new/op_delete[].md | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/reference/new/op_delete.md b/reference/new/op_delete.md index ede81627b9..b77d25ebd1 100644 --- a/reference/new/op_delete.md +++ b/reference/new/op_delete.md @@ -37,6 +37,10 @@ constexpr void operator delete(void* ptr, void*) noexcept; - (7) : 配置newで確保された記憶域の解放 +## 事前条件 +- (1), (5) : 処理系が厳密なポインタ安全性 ([`pointer_safety::strict`](/reference/memory/pointer_safety.md)) を持つ場合、`ptr`は安全に派生したポインタであること + + ## 効果 [`new`](op_new.md)演算子によって動的に確保した記憶域を解放する。 @@ -88,5 +92,9 @@ int main() ## 参照 - [LWG 2458. N3778 and new library deallocation signatures](https://wg21.cmeerw.net/lwg/issue2458) +- [LWG Issue 1006. `operator delete` in garbage collected implementation](https://cplusplus.github.io/LWG/issue1006) + - C++11で、厳密なポインタ安全性を持つ処理系では`ptr`が安全に派生したポインタでなければならないという事前条件が追加された +- [LWG Issue 1524. Allocation functions are missing happens-before requirements and guarantees](https://cplusplus.github.io/LWG/issue1524) + - C++11で、記憶域の確保・解放関数について、ある確保が以前の解放よりも後に発生するという順序関係が規定された。再利用された記憶域に対するアクセスがデータ競合とならないようにするため - [LWG Issue 4477. Placement `operator delete` should be constexpr](https://cplusplus.github.io/LWG/issue4477) - C++26で、配置`new`に対応する配置`operator delete` (7) に`constexpr`が付いた。定数式評価中の配置new式でコンストラクタが例外を送出した場合に、この解放処理が定数評価文脈で呼ばれるために必要となった diff --git a/reference/new/op_delete[].md b/reference/new/op_delete[].md index 4108cbc675..46ac3c328d 100644 --- a/reference/new/op_delete[].md +++ b/reference/new/op_delete[].md @@ -37,6 +37,10 @@ constexpr void operator delete[](void* ptr, void*) noexcept; - (7) : 配置newで確保された配列オブジェクトの記憶域の解放 +## 事前条件 +- (1), (5) : 処理系が厳密なポインタ安全性 ([`pointer_safety::strict`](/reference/memory/pointer_safety.md)) を持つ場合、`ptr`は安全に派生したポインタであること + + ## 効果 [`new[]`](op_new[].md)演算子によって動的に確保した記憶域を解放する。 @@ -88,5 +92,7 @@ int main() ## 参照 - [LWG 2458. N3778 and new library deallocation signatures](https://wg21.cmeerw.net/lwg/issue2458) +- [LWG Issue 1006. `operator delete` in garbage collected implementation](https://cplusplus.github.io/LWG/issue1006) + - C++11で、厳密なポインタ安全性を持つ処理系では`ptr`が安全に派生したポインタでなければならないという事前条件が追加された - [LWG Issue 4477. Placement `operator delete` should be constexpr](https://cplusplus.github.io/LWG/issue4477) - C++26で、配置`new[]`に対応する配置`operator delete[]` (7) に`constexpr`が付いた。定数式評価中の配置new式でコンストラクタが例外を送出した場合に、この解放処理が定数評価文脈で呼ばれるために必要となった From 2b2a4cdae8cd5726e91f53dfa7a86c7e2ba7052b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:34:43 +0900 Subject: [PATCH 110/147] =?UTF-8?q?new,=20delete=E6=BC=94=E7=AE=97?= =?UTF-8?q?=E5=AD=90=20:=20happens=20after=E3=81=AB=E3=81=A4=E3=81=84?= =?UTF-8?q?=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/new/op_delete.md | 2 ++ reference/new/op_new.md | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/reference/new/op_delete.md b/reference/new/op_delete.md index b77d25ebd1..8620040512 100644 --- a/reference/new/op_delete.md +++ b/reference/new/op_delete.md @@ -48,6 +48,8 @@ constexpr void operator delete(void* ptr, void*) noexcept; ## 備考 +- これらの関数と、利用者が置き換えた版、および[`std::free`](/reference/cstdlib/free.md)は、異なるスレッドから並行に呼び出されてもデータ競合を引き起こさない。 + ある記憶域の確保が、同じ記憶域を返した以前の解放よりも後に発生する(*happens after*)ことが保証されるため、再利用された記憶域へのアクセスがデータ競合とならない。 - `alignment` 引数を取らない `delete` 演算子に渡される `ptr` は、 `alignment` 引数を取らない `new` 演算子によって確保されたものでなければならない。 - `alignment` 引数を取る `delete` 演算子に渡される `ptr` は、同じ `alignment` の値を取った `alignment` 版 `new` 演算子によって確保されたものでなければならない。 diff --git a/reference/new/op_new.md b/reference/new/op_new.md index f34c07b010..395be5dcf7 100644 --- a/reference/new/op_new.md +++ b/reference/new/op_new.md @@ -82,6 +82,9 @@ constexpr void* operator new(std::size_t size, ## 備考 +- これらの関数と、利用者が置き換えた版、および[`std::calloc`](/reference/cstdlib/calloc.md)・[`std::malloc`](/reference/cstdlib/malloc.md)・[`std::realloc`](/reference/cstdlib/realloc.md)・[`std::free`](/reference/cstdlib/free.md)は、異なるスレッドから並行に呼び出されてもデータ競合を引き起こさない。 + ある記憶域の確保が、同じ記憶域を返した以前の解放よりも後に発生する(*happens after*)ことが保証されるため、再利用された記憶域へのアクセスがデータ競合とならない。 + - (1)と(2)、および、(3)と(4) の形式は、`size` が `0` でも他の確保済みの記憶域と異なるアドレスを返す。 ただし、記憶域の確保に失敗する可能性もあり、また、成功しても当該ポインタを間接参照した場合は未定義動作を引き起こす。 @@ -97,7 +100,7 @@ constexpr void* operator new(std::size_t size, - (1)と(2) の形式の `operator new` を呼び出すだけであれば、(`new` 式から間接的に呼ばれる場合も含めて)`new` ヘッダをインクルードする必要はない。 - (1)と(2) の形式の詳細な正確な挙動は以下の通りである。 - - `size` で指定したサイズ(バイト)の記憶域を確保しようとする。なお、記憶域の確保に C 互換ライブラリ関数 `malloc()` や [`aligned_alloc()`](/reference/cstdlib/aligned_alloc.md) を用いるか否かは規定されていない。 + - `size` で指定したサイズ(バイト)の記憶域を確保しようとする。なお、記憶域の確保に C 互換ライブラリ関数 [`malloc()`](/reference/cstdlib/malloc.md) や [`aligned_alloc()`](/reference/cstdlib/aligned_alloc.md) を用いるか否かは規定されていない。 - もし、記憶域を確保できた場合、確保した先頭アドレスを返す。 - もし、確保できなかった場合、 - 現在の [`new_handler`](new_handler.md) が ヌルポインタであれば、[`bad_alloc`](bad_alloc.md) 例外を送出する。 @@ -177,3 +180,5 @@ int main() - C++26で`[[nodiscard]]`指定が削除された - [P2747R2 constexpr placement new](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2747r2.html) - C++26で配置newのオーバーロードが`constexpr`対応した +- [LWG Issue 1524. Allocation functions are missing happens-before requirements and guarantees](https://cplusplus.github.io/LWG/issue1524) + - C++11で、記憶域の確保・解放関数について、ある確保が以前の解放よりも後に発生するという順序関係が規定された。再利用された記憶域に対するアクセスがデータ競合とならないようにするため From 7c1967adf97713f492ab7dc46e37855de3b4af93 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:38:27 +0900 Subject: [PATCH 111/147] =?UTF-8?q?basic=5Fostream::sentry=E3=81=AEbool?= =?UTF-8?q?=E5=A4=89=E6=8F=9B=E6=BC=94=E7=AE=97=E5=AD=90=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=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/ostream/basic_ostream/sentry/op_bool.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/reference/ostream/basic_ostream/sentry/op_bool.md b/reference/ostream/basic_ostream/sentry/op_bool.md index 79f9632588..aa0dd78d91 100644 --- a/reference/ostream/basic_ostream/sentry/op_bool.md +++ b/reference/ostream/basic_ostream/sentry/op_bool.md @@ -5,8 +5,8 @@ * function[meta id-type] ```cpp -operator bool() const; // C++98 まで -explicit operator bool() const; // C++11 から +operator bool() const; // (1) C++98 +explicit operator bool() const; // (1) C++11 ``` ## 概要 @@ -15,5 +15,11 @@ explicit operator bool() const; // C++11 から ## 戻り値 本オブジェクトの構築時に出力処理の前処理が正常に完了していれば `true`、そうでなければ `false`。 -## 参照 + +## バージョン +### 言語 +- C++98 + + +## 関連項目 - [`(constructor)`](op_constructor.md) From 488d56686e4dc89e83531e05bf599e845bbec7d0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:39:10 +0900 Subject: [PATCH 112/147] =?UTF-8?q?basic=5Fostream::sentry=20:=20=E5=AE=A3?= =?UTF-8?q?=E8=A8=80=E3=82=92=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E6=9B=B8=E3=81=8D=E5=88=86=E3=81=91=20(=E5=AE=A3=E8=A8=80?= =?UTF-8?q?=E3=81=AE=E3=81=BF=E3=81=AE=E9=A0=85=E7=9B=AE=E3=82=92=E3=81=A9?= =?UTF-8?q?=E3=81=86=E6=9B=B8=E3=81=8F=E3=81=8B=E3=81=8C=E3=82=80=E3=81=9A?= =?UTF-8?q?=E3=81=8B=E3=81=97=E3=81=84=E3=81=AE=E3=81=A7=E4=B8=80=E6=97=A6?= =?UTF-8?q?=E3=81=93=E3=81=AE=E3=81=BE=E3=81=BE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ostream/basic_ostream/sentry.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/reference/ostream/basic_ostream/sentry.md b/reference/ostream/basic_ostream/sentry.md index 8266f66de0..8ad553dac5 100644 --- a/reference/ostream/basic_ostream/sentry.md +++ b/reference/ostream/basic_ostream/sentry.md @@ -11,10 +11,16 @@ namespace std { public: explicit sentry(basic_ostream& os); ~sentry(); - explicit operator bool() const; - sentry(const sentry&) = delete; - sentry& operator=(const setnry&) = delete; + operator bool() const; // C++98 + explicit operator bool() const; // C++11 + + private: + sentry(const sentry&); // C++98 宣言のみ + sentry& operator=(const sentry&); // C++98 宣言のみ + public: + sentry(const sentry&) = delete; // C++11 + sentry& operator=(const sentry&) = delete; // C++11 }; } ``` From 831279120fb2287aba1d8340ffe8110a4c475cda Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:43:33 +0900 Subject: [PATCH 113/147] =?UTF-8?q?stringstream=E3=81=AE=E4=BB=A3=E5=85=A5?= =?UTF-8?q?=E6=BC=94=E7=AE=97=E5=AD=90=20:=20LWG=20Issue=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/op_assign.md | 5 +++++ reference/sstream/basic_ostringstream/op_assign.md | 5 +++++ reference/sstream/basic_stringbuf/op_assign.md | 5 +++++ reference/sstream/basic_stringstream/op_assign.md | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/reference/sstream/basic_istringstream/op_assign.md b/reference/sstream/basic_istringstream/op_assign.md index 03d9675e7d..e58b7a6b47 100644 --- a/reference/sstream/basic_istringstream/op_assign.md +++ b/reference/sstream/basic_istringstream/op_assign.md @@ -53,3 +53,8 @@ first - [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): 5.1.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [LWG Issue 900. Stream move-assignment](https://cplusplus.github.io/LWG/issue900) + - C++11で、ムーブ代入の効果が`swap(rhs)`から、基底クラスと各メンバを`rhs`の対応する基底・メンバからムーブ代入することへ改められた。`swap`では代入先が元々持っていた状態が`rhs`へ残ってしまうため diff --git a/reference/sstream/basic_ostringstream/op_assign.md b/reference/sstream/basic_ostringstream/op_assign.md index 44d32b5b8d..ac5860b258 100644 --- a/reference/sstream/basic_ostringstream/op_assign.md +++ b/reference/sstream/basic_ostringstream/op_assign.md @@ -55,3 +55,8 @@ first - [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): ?? + + +## 参照 +- [LWG Issue 900. Stream move-assignment](https://cplusplus.github.io/LWG/issue900) + - C++11で、ムーブ代入の効果が`swap(rhs)`から、基底クラスと各メンバを`rhs`の対応する基底・メンバからムーブ代入することへ改められた。`swap`では代入先が元々持っていた状態が`rhs`へ残ってしまうため diff --git a/reference/sstream/basic_stringbuf/op_assign.md b/reference/sstream/basic_stringbuf/op_assign.md index c64d52fe14..987830c53e 100644 --- a/reference/sstream/basic_stringbuf/op_assign.md +++ b/reference/sstream/basic_stringbuf/op_assign.md @@ -53,3 +53,8 @@ first - [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): ?? + + +## 参照 +- [LWG Issue 900. Stream move-assignment](https://cplusplus.github.io/LWG/issue900) + - C++11で、ムーブ代入の効果が`swap(rhs)`から、ムーブ構築した場合と同じ観測可能な状態になることへ改められた。`swap`では代入先が元々持っていた状態が`rhs`へ残ってしまうため diff --git a/reference/sstream/basic_stringstream/op_assign.md b/reference/sstream/basic_stringstream/op_assign.md index 656ac0d9b4..03faf34f8f 100644 --- a/reference/sstream/basic_stringstream/op_assign.md +++ b/reference/sstream/basic_stringstream/op_assign.md @@ -53,3 +53,8 @@ first - [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): ?? + + +## 参照 +- [LWG Issue 900. Stream move-assignment](https://cplusplus.github.io/LWG/issue900) + - C++11で、ムーブ代入の効果が`swap(rhs)`から、基底クラスと各メンバを`rhs`の対応する基底・メンバからムーブ代入することへ改められた。`swap`では代入先が元々持っていた状態が`rhs`へ残ってしまうため From 28c1325df3434bc2cba3764b0efa4de41ea49f9c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:44:23 +0900 Subject: [PATCH 114/147] =?UTF-8?q?basic=5Fstringbuf::str=20:=20=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E4=BD=8D=E7=BD=AE=E3=82=92=E6=9C=AB=E5=B0=BE=E3=81=AB?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=99=E3=82=8B=E3=81=8B=E3=81=A9=E3=81=86?= =?UTF-8?q?=E3=81=8B=E3=81=AE=E5=88=A4=E5=AE=9A=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/sstream/basic_stringbuf/str.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/sstream/basic_stringbuf/str.md b/reference/sstream/basic_stringbuf/str.md index 15c3e99a87..a00dcb865d 100644 --- a/reference/sstream/basic_stringbuf/str.md +++ b/reference/sstream/basic_stringbuf/str.md @@ -50,6 +50,8 @@ void str(const T& t); // (7) C++26 - (6) : 与えられた文字列オブジェクト`s`をムーブして設定する - (7) : [`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列を設定する +(4)〜(7)では、設定後に入力位置と出力位置がオープンモードに従って初期化される。オープンモードに[`ios_base::ate`](/reference/ios/ios_base/type-openmode.md)が含まれる場合、出力位置は文字列の末尾に設定される。 + ## 例 ### 基本的な使い方 @@ -158,3 +160,5 @@ 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)に対応した +- [LWG Issue 1448. Concerns about `basic_stringbuf::str`(`basic_string`) postconditions](https://cplusplus.github.io/LWG/issue1448) + - C++11で、出力位置を末尾に設定するかどうかの判定が`ios_base::in`から[`ios_base::ate`](/reference/ios/ios_base/type-openmode.md)へ修正された From 3649c65a3e8aa1b269395ea3efbe80b6233c4b5c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:45:24 +0900 Subject: [PATCH 115/147] =?UTF-8?q?basic=5Fstreambuf=20:=20=E5=B0=8E?= =?UTF-8?q?=E5=85=A5=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=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 --- reference/streambuf/basic_streambuf/op_assign.md | 4 ++-- reference/streambuf/basic_streambuf/op_constructor.md | 4 ++-- reference/streambuf/basic_streambuf/swap.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/streambuf/basic_streambuf/op_assign.md b/reference/streambuf/basic_streambuf/op_assign.md index 16704f8d24..b6c507bd74 100644 --- a/reference/streambuf/basic_streambuf/op_assign.md +++ b/reference/streambuf/basic_streambuf/op_assign.md @@ -10,7 +10,7 @@ namespace std { template> class basic_streambuf { protected: - basic_streambuf& operator=(const basic_streambuf& rhs); + basic_streambuf& operator=(const basic_streambuf& rhs); // (1) C++11 …… }; @@ -69,7 +69,7 @@ B ## バージョン ### 言語 -- C++98 +- C++11 ## 参照 - [`eback()`](eback.md) diff --git a/reference/streambuf/basic_streambuf/op_constructor.md b/reference/streambuf/basic_streambuf/op_constructor.md index c764eb4d4c..4bcc343401 100644 --- a/reference/streambuf/basic_streambuf/op_constructor.md +++ b/reference/streambuf/basic_streambuf/op_constructor.md @@ -9,8 +9,8 @@ namespace std { template> class basic_streambuf { protected: - basic_streambuf(); // (1) - basic_streambuf(const basic_streambuf& rhs); // (2) + basic_streambuf(); // (1) C++98 + basic_streambuf(const basic_streambuf& rhs); // (2) C++11 …… }; diff --git a/reference/streambuf/basic_streambuf/swap.md b/reference/streambuf/basic_streambuf/swap.md index 84e71b0dfb..fcd12e5b21 100644 --- a/reference/streambuf/basic_streambuf/swap.md +++ b/reference/streambuf/basic_streambuf/swap.md @@ -10,7 +10,7 @@ namespace std { template> class basic_streambuf { protected: - void swap(basic_streambuf& rhs); + void swap(basic_streambuf& rhs); // (1) C++11 …… }; @@ -57,4 +57,4 @@ B ## バージョン ### 言語 -- C++98 +- C++11 From 0b26e19c83dd061c6c05cfbd2cc392414038afe9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:46:29 +0900 Subject: [PATCH 116/147] =?UTF-8?q?basic=5Fstreambuf::xsputn=20:=20overflo?= =?UTF-8?q?w=E3=82=92=E8=AA=AD=E3=81=BF=E5=87=BA=E3=81=99=E3=81=8B?= =?UTF-8?q?=E3=81=A9=E3=81=86=E3=81=8B=E3=81=8C=E6=9C=AA=E8=A6=8F=E5=AE=9A?= =?UTF-8?q?=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/streambuf/basic_streambuf/xsputn.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/reference/streambuf/basic_streambuf/xsputn.md b/reference/streambuf/basic_streambuf/xsputn.md index a8d265a505..de222c198d 100644 --- a/reference/streambuf/basic_streambuf/xsputn.md +++ b/reference/streambuf/basic_streambuf/xsputn.md @@ -21,11 +21,18 @@ namespace std { 出力列に複数文字を書き込む。 ## 効果 -sからn文字を出力列に書き込む。書き込み可能領域が一杯になると、そこで書き込みを停止する。 +`s`から`n`文字を、[`sputc()`](sputc.md)を繰り返し呼び出したかのようにして出力列に書き込む。`n`文字を書き込むか、[`sputc()`](sputc.md)の呼び出しが[`Traits::eof()`](/reference/string/char_traits/eof.md)を返す状況になった時点で、書き込みを停止する。 + ## 戻り値 書き込んだ文字数。 + +## 備考 +- `pptr() == epptr()`となった時点でこの関数が[`overflow()`](overflow.md)を呼び出すか、それとも別の手段で同じ効果を実現するかは、未規定である。 + - そのため、派生クラスで[`overflow()`](overflow.md)のみをオーバーライドしても、`xsputn()`経由の出力でそれが呼ばれるとは限らない。効率のために`xsputn()`自体をオーバーライドする処理系があるためである。 + + ## 例 ```cpp example #include @@ -65,5 +72,10 @@ ABCAB ### 言語 - C++98 -## 参照 +## 関連項目 - [`sputn()`](sputn.md) + + +## 参照 +- [LWG Issue 565. `xsputn` inefficient](https://cplusplus.github.io/LWG/issue565) + - C++11で、`pptr() == epptr()`となったときに[`overflow()`](overflow.md)を呼び出すかどうかが未規定であると明記された。デバイスへ直接書き出すなど、`sputc()`や`overflow()`を経由しない効率的な実装を許すためであり、それ以前も同様の実装が行われていた From 301378e0a5fc9868ceffdc985fc1f2ee6ed2b22e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:46:56 +0900 Subject: [PATCH 117/147] =?UTF-8?q?system=5Ferror=20:=20LWG=20Issue?= =?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/system_error/error_code/op_constructor.md | 2 ++ reference/system_error/error_condition/op_constructor.md | 2 ++ reference/system_error/generic_category.md | 2 ++ reference/system_error/system_category.md | 4 ++++ reference/system_error/system_error.md | 5 +++++ 5 files changed, 15 insertions(+) diff --git a/reference/system_error/error_code/op_constructor.md b/reference/system_error/error_code/op_constructor.md index 4c02afea37..abdf9e890e 100644 --- a/reference/system_error/error_code/op_constructor.md +++ b/reference/system_error/error_code/op_constructor.md @@ -196,5 +196,7 @@ not found ## 参照 +- [LWG Issue 1237. Constrained `error_code`/`error_condition` members](https://cplusplus.github.io/LWG/issue1237) + - C++11で、(3)の制約が`enable_if`によるデフォルトテンプレート引数から、オーバーロード解決に参加する条件という規定へ改められた。制約の実現方法を処理系に委ねるため - [LWG Issue 3629. `make_error_code` and `make_error_condition` are customization points](https://cplusplus.github.io/LWG/issue3629) - C++23で、`make_error_code`/`make_error_condition`がADLによって探索されるカスタマイゼーションポイントであることが明記された diff --git a/reference/system_error/error_condition/op_constructor.md b/reference/system_error/error_condition/op_constructor.md index 4d3424677c..549eb238fc 100644 --- a/reference/system_error/error_condition/op_constructor.md +++ b/reference/system_error/error_condition/op_constructor.md @@ -127,3 +127,5 @@ generic ## 参照 +- [LWG Issue 1237. Constrained `error_code`/`error_condition` members](https://cplusplus.github.io/LWG/issue1237) + - C++11で、列挙値からのコンストラクタの制約が`enable_if`によるデフォルトテンプレート引数から、オーバーロード解決に参加する条件という規定へ改められた。制約の実現方法を処理系に委ねるため diff --git a/reference/system_error/generic_category.md b/reference/system_error/generic_category.md index 5e6f02d8af..7eaf554933 100644 --- a/reference/system_error/generic_category.md +++ b/reference/system_error/generic_category.md @@ -70,3 +70,5 @@ Invalid argument ## 参照 +- [LWG Issue 1372. Adopt recommended practice for standard error categories](https://cplusplus.github.io/LWG/issue1372) + - C++11で、この関数の呼び出しがすべて同一のオブジェクトへの参照を返すことが規定された。返されたカテゴリを`operator==`で比較できるようにするため diff --git a/reference/system_error/system_category.md b/reference/system_error/system_category.md index a2d173c5b4..673dec2999 100644 --- a/reference/system_error/system_category.md +++ b/reference/system_error/system_category.md @@ -72,5 +72,9 @@ Invalid argument ## 参照 +- [LWG Issue 890. Improving `` initialization](https://cplusplus.github.io/LWG/issue890) + - C++11で、標準ライブラリが返す`error_code`の`category()`について、記述が「`std::system_category`への参照」から「`std::system_category()`」へ改められた。`system_category`は関数であり、参照ではないため +- [LWG Issue 1372. Adopt recommended practice for standard error categories](https://cplusplus.github.io/LWG/issue1372) + - C++11で、この関数の呼び出しがすべて同一のオブジェクトへの参照を返すことが規定された。返されたカテゴリを`operator==`で比較できるようにするため - [LWG Issue 3598. `system_category().default_error_condition(0)` is underspecified](https://cplusplus.github.io/LWG/issue3598) - C++23で、引数が`0`の場合に[`generic_category()`](generic_category.md)を使った[`error_condition`](error_condition.md)を返すことが明確化された diff --git a/reference/system_error/system_error.md b/reference/system_error/system_error.md index 9b91ab4d60..84992c2f8e 100644 --- a/reference/system_error/system_error.md +++ b/reference/system_error/system_error.md @@ -66,3 +66,8 @@ 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] + + +## 参照 +- [LWG Issue 1103. `system_error` constructor postcondition overly strict](https://cplusplus.github.io/LWG/issue1103) + - C++11で、コンストラクタの事後条件が「[`what()`](/reference/exception/exception/what.md)が`what_arg`と完全一致すること」から「`what()`の戻り値が`what_arg`を部分文字列として含むこと」へ緩和された。処理系は`what()`にエラーコードの説明を付加するため、完全一致は実装不可能だった From 4c5e714120701a1c79aa7d3f9d40d7c1e9c55808 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:47:15 +0900 Subject: [PATCH 118/147] =?UTF-8?q?=20:=20LWG=20Issue=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/thread/this_thread/yield.md | 2 ++ reference/thread/thread/detach.md | 2 ++ reference/thread/thread/hardware_concurrency.md | 2 ++ reference/thread/thread/id.md | 2 ++ reference/thread/thread/join.md | 2 ++ reference/thread/thread/op_constructor.md | 2 ++ 6 files changed, 12 insertions(+) diff --git a/reference/thread/this_thread/yield.md b/reference/thread/this_thread/yield.md index 229e1ae7c3..1d3fbe77f7 100644 --- a/reference/thread/this_thread/yield.md +++ b/reference/thread/this_thread/yield.md @@ -80,3 +80,5 @@ result=42 ## 参照 - [thread::yield()の実装 - Faith and Brave - C++で遊ぼう](http://d.hatena.ne.jp/faith_and_brave/20120618/1340000626) +- [LWG Issue 888. `this_thread::yield` too strong](https://cplusplus.github.io/LWG/issue888) + - C++11で、効果の記述が「OSに他のスレッドをスケジュールする機会を与える」から「処理系に再スケジュールの機会を与える」へ改められた。OSを持たない環境や、他に実行可能なスレッドがない場合を排除しないため diff --git a/reference/thread/thread/detach.md b/reference/thread/thread/detach.md index ebed035168..2538e3507e 100644 --- a/reference/thread/thread/detach.md +++ b/reference/thread/thread/detach.md @@ -87,3 +87,5 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 +- [LWG Issue 963. Various threading bugs #13](https://cplusplus.github.io/LWG/issue963) + - C++11で、エラー条件の文言が整理され、[`invalid_argument`](/reference/system_error/errc.md)の条件が「デタッチ可能なスレッドでない場合」から「[`joinable()`](joinable.md)でない場合」へ改められた diff --git a/reference/thread/thread/hardware_concurrency.md b/reference/thread/thread/hardware_concurrency.md index 5294ca4b52..981432b62a 100644 --- a/reference/thread/thread/hardware_concurrency.md +++ b/reference/thread/thread/hardware_concurrency.md @@ -54,3 +54,5 @@ concurrency=4 - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 +- [LWG Issue 1089. Unify "Throws: Nothing." specifications](https://cplusplus.github.io/LWG/issue1089) + - C++11で、この関数が例外を送出しないことが明記された diff --git a/reference/thread/thread/id.md b/reference/thread/thread/id.md index 0f360a6800..0d2c711c5c 100644 --- a/reference/thread/thread/id.md +++ b/reference/thread/thread/id.md @@ -110,3 +110,5 @@ main=824a30 - [LWG Issue 783. `thread::id` reuse](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#783) - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [LWG Issue 1277. `std::thread::id` should be trivially copyable](https://cplusplus.github.io/LWG/issue1277) + - C++11で、この型がトリビアルコピー可能であることが規定された。アトミック操作の対象にできるようにするため diff --git a/reference/thread/thread/join.md b/reference/thread/thread/join.md index 51a42ba067..c62b1b9be6 100644 --- a/reference/thread/thread/join.md +++ b/reference/thread/thread/join.md @@ -78,3 +78,5 @@ int main() ## 参照 +- [LWG Issue 1033. `thread::join()` effects?](https://cplusplus.github.io/LWG/issue1033) + - C++11で、スレッドの完了までブロックするという効果が明記され、事後条件が「スレッドが完了していること」と[`get_id()`](get_id.md)` == `[`id()`](/reference/thread/thread/id.md)であることへ整理された diff --git a/reference/thread/thread/op_constructor.md b/reference/thread/thread/op_constructor.md index a3ad1132b8..c3ed135d7d 100644 --- a/reference/thread/thread/op_constructor.md +++ b/reference/thread/thread/op_constructor.md @@ -111,6 +111,8 @@ int main() ## 参照 +- [LWG Issue 929. Thread constructor](https://cplusplus.github.io/LWG/issue929) + - C++11で、関数オブジェクトのみをとるコンストラクタと引数付きのコンストラクタが(2)の可変引数コンストラクタひとつに統合され、`explicit`が付加された。また、実引数を`DECAY_COPY`によって呼び出し元スレッド上でコピーすることが規定された - [LWG Issue 2097. `packaged_task` constructors should be constrained](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2097) - [LWG Issue 3039. Unnecessary `decay` in `thread` and `packaged_task`](https://wg21.cmeerw.net/lwg/issue3039) - [LWG Issue 3476. `thread` and `jthread` constructors require that the parameters be move-constructible](https://cplusplus.github.io/LWG/issue3476) From d9f83d63ae46d505af11ba985a9fd61058b1837c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:47:43 +0900 Subject: [PATCH 119/147] =?UTF-8?q?tuple=E3=81=AE=E3=83=87=E3=83=95?= =?UTF-8?q?=E3=82=A9=E3=83=AB=E3=83=88=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=A9=E3=82=AF=E3=82=BF=20:=20=E5=80=A4=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E3=81=95=E3=82=8C=E3=82=8B=E3=81=93=E3=81=A8=E3=81=AB?= =?UTF-8?q?=E3=81=AA=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/tuple/tuple/op_constructor.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/reference/tuple/tuple/op_constructor.md b/reference/tuple/tuple/op_constructor.md index 1a75fb5800..1f73659807 100644 --- a/reference/tuple/tuple/op_constructor.md +++ b/reference/tuple/tuple/op_constructor.md @@ -222,7 +222,7 @@ explicit(see below) constexpr * tuple-like[link ../tuple-like.md] ## tupleオブジェクトの構築 -- (1) : デフォルトコンストラクタ(すべての要素を初期化して構築) +- (1) : デフォルトコンストラクタ(すべての要素を値初期化して構築) - (2) : 可変テンプレートパラメータの型の値によるコピー構築 - (3) : 可変テンプレートパラメータの型に変換可能な値によるムーブ構築 - (4) : コピーコンストラクタ @@ -442,11 +442,11 @@ int main() - [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`の導入 +- [LWG Issue 886. `tuple` construction](https://cplusplus.github.io/LWG/issue886) + - C++11の策定時に、デフォルトコンストラクタ(1)の効果が、各要素のデフォルト初期化から値初期化へ改められた。組み込み型の要素が未初期化のままになることを避けるため - [LWG Issue 2312. `tuple`'s constructor constraints need to be phrased more precisely](https://cplusplus.github.io/LWG/issue2312) - C++17で、`tuple`の各コンストラクタが要素数の一致等の条件を満たす場合のみオーバーロード解決に参加するよう、制約がより厳密に規定された - この修正は欠陥報告(DR)であり、C++11以降に遡及して適用される。処理系は当初からこの通りに振る舞っており、規格の文言が不正確だっただけであるため -- [LWG Issue 2367. `pair` and `tuple` are not correctly implemented for `is_constructible` with no args](https://cplusplus.github.io/LWG/issue2367) - - C++17で、デフォルトコンストラクタ(1)が、いずれかの要素型がデフォルト構築可能でない場合はオーバーロード解決に参加しないよう制約化された - [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)`構文への対応 @@ -454,13 +454,15 @@ int main() - [`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 Issue 2549. Tuple EXPLICIT constructor templates that take tuple parameters end up taking references to temporaries and will create dangling references](https://wg21.cmeerw.net/lwg/issue2549) +- [LWG Issue 2367. `pair` and `tuple` are not correctly implemented for `is_constructible` with no args](https://cplusplus.github.io/LWG/issue2367) + - C++17で、デフォルトコンストラクタ(1)が、いずれかの要素型がデフォルト構築可能でない場合はオーバーロード解決に参加しないよう制約化された - [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)として使用できるようにする -- [LWG Issue 2899. `is_(nothrow_)move_constructible` and `tuple`, `optional` and `unique_ptr`](https://cplusplus.github.io/LWG/issue2899) - - C++20で、ムーブコンストラクタ(5)が、いずれかの要素型がムーブ構築可能でない場合はオーバーロード解決に参加しないよう制約化された +- [LWG Issue 2549. Tuple EXPLICIT constructor templates that take tuple parameters end up taking references to temporaries and will create dangling references](https://wg21.cmeerw.net/lwg/issue2549) - [LWG 3121 tuple constructor constraints for UTypes&&... overloads](https://cplusplus.github.io/LWG/issue3121) - C++23 での (3) のコンストラクタの制約の変更(`disambiguating-constraint`等)について +- [LWG Issue 2899. `is_(nothrow_)move_constructible` and `tuple`, `optional` and `unique_ptr`](https://cplusplus.github.io/LWG/issue2899) + - C++20で、ムーブコンストラクタ(5)が、いずれかの要素型がムーブ構築可能でない場合はオーバーロード解決に参加しないよう制約化された - [LWG Issue 3158. `tuple(allocator_arg_t, const Alloc&)` should be conditionally `explicit`](https://cplusplus.github.io/LWG/issue3158) - C++20で、アロケータ拡張デフォルトコンストラクタ(15)が、非アロケータ版(1)と同じ条件で`explicit`となるよう修正された - [LWG Issue 3211. `std::tuple<>` should be trivially constructible](https://cplusplus.github.io/LWG/issue3211) From 42040ed4cc1241ee9dab900ae29873102c8c8fd7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:48:12 +0900 Subject: [PATCH 120/147] =?UTF-8?q?=20:=20LWG=20Issue=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/tuple/forward_as_tuple.md | 4 ++++ reference/tuple/tuple/get.md | 2 ++ reference/tuple/tuple/op_less.md | 2 ++ reference/tuple/tuple/swap.md | 2 ++ reference/tuple/tuple_cat.md | 2 ++ reference/tuple/tuple_element.md | 2 ++ reference/tuple/tuple_size.md | 6 ++++-- 7 files changed, 18 insertions(+), 2 deletions(-) diff --git a/reference/tuple/forward_as_tuple.md b/reference/tuple/forward_as_tuple.md index 8cb930eb01..cc571d97ae 100644 --- a/reference/tuple/forward_as_tuple.md +++ b/reference/tuple/forward_as_tuple.md @@ -70,3 +70,7 @@ int main() ## 参照 - [LWG2275 - Why is forward_as_tuple not constexpr?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2275) +- [LWG Issue 1384. Function `pack_arguments` is poorly named](https://cplusplus.github.io/LWG/issue1384) + - C++11の策定時に、この関数の名前が`pack_arguments`から`forward_as_tuple`へ改められた +- [LWG Issue 1386. `pack_arguments` overly complex](https://cplusplus.github.io/LWG/issue1386) + - C++11の策定時に、戻り値の型が引数の型ごとに導出する複雑な規定から、単純に`tuple`とする形へ簡略化された diff --git a/reference/tuple/tuple/get.md b/reference/tuple/tuple/get.md index c00d7c7535..65fe4b53ca 100644 --- a/reference/tuple/tuple/get.md +++ b/reference/tuple/tuple/get.md @@ -188,5 +188,7 @@ int main() { - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) - [N3887 Consistent Metafunction Aliases](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3887.pdf) - [N3670 Wording for Addressing Tuples by Type: Revision 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3670.html) +- [LWG Issue 1191. `tuple` `get` API should respect rvalues](https://cplusplus.github.io/LWG/issue1191) + - C++11で、右辺値の`tuple`から要素を取り出す(2)のオーバーロードが追加された - [LWG Issue 2485. `get()` should be overloaded for `const tuple&&`](https://wg21.cmeerw.net/lwg/issue2485) - C++17で`const tuple&&`をとるオーバーロードが追加された。このようなオーバーロードはほかでは用意していないが、`tuple`は基本的(fundamental)な型であるために用意された diff --git a/reference/tuple/tuple/op_less.md b/reference/tuple/tuple/op_less.md index b979d40d99..40e2ef458b 100644 --- a/reference/tuple/tuple/op_less.md +++ b/reference/tuple/tuple/op_less.md @@ -87,3 +87,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での三方比較演算子の追加と、関連する演算子の自動導出 +- [LWG Issue 1335. Insufficient requirements for `tuple::operator<`()](https://cplusplus.github.io/LWG/issue1335) + - C++11で、要件に`get(u) < get(t)`も有効な式であることが追加された。辞書式比較の実装では両方向の比較が必要なため diff --git a/reference/tuple/tuple/swap.md b/reference/tuple/tuple/swap.md index cf470662a8..a5bf2ffca2 100644 --- a/reference/tuple/tuple/swap.md +++ b/reference/tuple/tuple/swap.md @@ -74,3 +74,5 @@ 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) +- [LWG Issue 1349. `swap` should not throw](https://cplusplus.github.io/LWG/issue1349) + - C++11の策定時に、ドラフト段階で無条件`noexcept`となっていたものが、条件付きの形 (`noexcept(see below)`) へ修正された diff --git a/reference/tuple/tuple_cat.md b/reference/tuple/tuple_cat.md index f3d8afe2d4..a3df313f96 100644 --- a/reference/tuple/tuple_cat.md +++ b/reference/tuple/tuple_cat.md @@ -99,3 +99,5 @@ 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) +- [LWG Issue 1385. `tuple_cat` should be a single variadic signature](https://cplusplus.github.io/LWG/issue1385) + - C++11で、2つの`tuple`を連結する複数のオーバーロードが、任意個の`tuple`を受け取る単一の可変引数テンプレートへ統合された diff --git a/reference/tuple/tuple_element.md b/reference/tuple/tuple_element.md index 06a6c707a4..c7f1e9adcb 100644 --- a/reference/tuple/tuple_element.md +++ b/reference/tuple/tuple_element.md @@ -106,3 +106,5 @@ int main() ## 参照 - [N3887 Consistent Metafunction Aliases](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3887.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) +- [LWG Issue 1118. `tuple` query APIs do not support cv-qualification](https://cplusplus.github.io/LWG/issue1118) + - C++11で、`const`/`volatile`/`const volatile`修飾された型に対する部分特殊化が追加された diff --git a/reference/tuple/tuple_size.md b/reference/tuple/tuple_size.md index f0a15c300b..6bf0e53cbf 100644 --- a/reference/tuple/tuple_size.md +++ b/reference/tuple/tuple_size.md @@ -87,7 +87,9 @@ int main() ## 参照 -- [LWG Issue 2770. `tuple_size` specialization is not SFINAE compatible and breaks decomposition declarations](https://wg21.cmeerw.net/lwg/issue2770) - - C++17で[構造化束縛](/lang/cpp17/structured_bindings.md)機能が導入されたことに合わせて、`tuple_size`がSFINAEと組み合わせて使用できるようになった +- [LWG Issue 1118. `tuple` query APIs do not support cv-qualification](https://cplusplus.github.io/LWG/issue1118) + - C++11で、`const`/`volatile`/`const volatile`修飾された型に対する部分特殊化が追加された - [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) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) +- [LWG Issue 2770. `tuple_size` specialization is not SFINAE compatible and breaks decomposition declarations](https://wg21.cmeerw.net/lwg/issue2770) + - C++17で[構造化束縛](/lang/cpp17/structured_bindings.md)機能が導入されたことに合わせて、`tuple_size`がSFINAEと組み合わせて使用できるようになった From 670588fde4925e3be427b15ac6988cf35f0e68f5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:49:02 +0900 Subject: [PATCH 121/147] =?UTF-8?q?decay=20:=20=E5=82=99=E8=80=83=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E5=80=A4=E6=B8=A1=E3=81=97=E3=81=AE=E5=BC=95?= =?UTF-8?q?=E6=95=B0=E5=9E=8B=E3=82=92=E6=A8=A1=E5=80=A3=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=82=E3=81=AE=E3=81=A7=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/type_traits/decay.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/type_traits/decay.md b/reference/type_traits/decay.md index 4d3b46e4e6..7929001011 100644 --- a/reference/type_traits/decay.md +++ b/reference/type_traits/decay.md @@ -33,6 +33,10 @@ namespace std { - それ以外の場合は、[`remove_cv`](remove_cv.md)`::type`した型を、メンバ型`type`として定義する。 +## 備考 +- この変換は、左辺値式を右辺値として使用する際に適用される、左辺値から右辺値への変換・配列からポインタへの変換・関数からポインタへの変換に相当する。それに加えて、値渡しの引数の型をより正確に模倣するために、クラス型からもCV修飾を取り除く。 + + ## 例 ```cpp example #include @@ -103,3 +107,5 @@ 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) +- [LWG Issue 1187. `std::decay`](https://cplusplus.github.io/LWG/issue1187) + - C++11で、この変換が値渡しの引数型を模倣するものであり、クラス型からもCV修飾を取り除く点で通常の変換とは異なる旨の注記が追加された From 9afe31d01015d8f783bbf4d622e50978ad07fb9f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:49:28 +0900 Subject: [PATCH 122/147] =?UTF-8?q?extent=20:=20=E5=8A=B9=E6=9E=9C?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E4=B8=8D=E8=B6=B3=E5=88=86=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/type_traits/extent.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/type_traits/extent.md b/reference/type_traits/extent.md index e004c31578..908ca9272b 100644 --- a/reference/type_traits/extent.md +++ b/reference/type_traits/extent.md @@ -23,6 +23,8 @@ namespace std { ## 効果 - 型`T`が配列型であり、配列の次元数が`I`より大きい場合、`I`次元目の要素数をメンバ定数`value`として定義する。 - 型`T`が配列型ではない、もしくは配列の次元数が`I`以下の場合、値`0`をメンバ定数`value`として定義する。 +- 型`T`が要素数不明の配列型`U[]`であり、`I`が`0`である場合、値`0`をメンバ定数`value`として定義する。 +- `I`の添字は0始まりである。 ## 備考 @@ -59,3 +61,5 @@ int main() {} ## 参照 - [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) +- [LWG Issue 931. type trait `extent`](https://cplusplus.github.io/LWG/issue931) + - C++11で、`I`が次元数と等しい場合も`0`となること、要素数不明の配列で`I`が`0`の場合も`0`となること、`I`の添字が0始まりであることが明記された From 85f638bd4bfcf1368e9e8e4d05c861fae52fa2ac Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:49:40 +0900 Subject: [PATCH 123/147] =?UTF-8?q?type=5Ftraits=20:=20LWG=20Issue?= =?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/alignment_of.md | 2 ++ reference/type_traits/integral_constant.md | 2 ++ reference/type_traits/result_of.md | 2 ++ 3 files changed, 6 insertions(+) diff --git a/reference/type_traits/alignment_of.md b/reference/type_traits/alignment_of.md index 7e182a1eae..e7ede96281 100644 --- a/reference/type_traits/alignment_of.md +++ b/reference/type_traits/alignment_of.md @@ -62,3 +62,5 @@ int main() ## 参照 - [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) +- [LWG Issue 1131. C++0x does not need `alignment_of`](https://cplusplus.github.io/LWG/issue1131) + - C++11で、要件が型の完全性などを個別に列挙するものから、`alignof(T)`が有効な式であることへ整理された diff --git a/reference/type_traits/integral_constant.md b/reference/type_traits/integral_constant.md index cb90a3f9a5..b12a1eeb9f 100644 --- a/reference/type_traits/integral_constant.md +++ b/reference/type_traits/integral_constant.md @@ -72,3 +72,5 @@ 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) +- [LWG Issue 1019. Make `integral_constant` objects useable in integral-constant-expressions](https://cplusplus.github.io/LWG/issue1019) + - C++11の策定時に、`value`が`constexpr`となり、`value_type`への変換演算子が追加された。`integral_constant`のオブジェクトを定数式で使用できるようにするため diff --git a/reference/type_traits/result_of.md b/reference/type_traits/result_of.md index 5751f8d9a9..ceb7c33f0c 100644 --- a/reference/type_traits/result_of.md +++ b/reference/type_traits/result_of.md @@ -162,5 +162,7 @@ Hello World - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - [P0604R0 Resolving GB 55, US 84, US 85, US 86](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0604r0.html) - [P0619R4 Reviewing deprecated facilities of C++17 for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0619r4.html) +- [LWG Issue 904. `result_of` argument types](https://cplusplus.github.io/LWG/issue904) + - C++11で、引数が左辺値として扱われる条件が「参照型の場合」から「左辺値参照型の場合」へ限定された。右辺値参照型の引数まで左辺値として扱われてしまっていたため - [LWG Issue 2940. `result_of` specification also needs a little cleanup](https://cplusplus.github.io/LWG/issue2940) - C++20で、非推奨annexへの移動時に失われていた「利用者による特殊化を禁止する(追加した場合は未定義動作)」規定が復元された。この修正は欠陥報告(DR)であり、C++17にも遡及して適用される From 20bda1c27c3ee9f6a5d736827d555400e813e6d1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:49:58 +0900 Subject: [PATCH 124/147] =?UTF-8?q?pair=20:=20LWG=20Issue=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/utility/pair/op_constructor.md | 6 ++++-- reference/utility/swap.md | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/reference/utility/pair/op_constructor.md b/reference/utility/pair/op_constructor.md index 213ce58eaf..add4393e2d 100644 --- a/reference/utility/pair/op_constructor.md +++ b/reference/utility/pair/op_constructor.md @@ -293,8 +293,8 @@ p8 : (X(1 2 3),Y(4 5)) - [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`の導入 -- [LWG Issue 2367. `pair` and `tuple` are not correctly implemented for `is_constructible` with no args](https://cplusplus.github.io/LWG/issue2367) - - C++17で、デフォルトコンストラクタ(1)が、いずれかの要素型がデフォルト構築可能でない場合はオーバーロード解決に参加しないよう制約化された +- [LWG Issue 811. `pair` of pointers no longer works with literal `0`](https://cplusplus.github.io/LWG/issue811) + - C++11で、(5)のコンストラクタが、`U`が`first_type`へ、`V`が`second_type`へそれぞれ暗黙変換可能な場合にのみオーバーロード解決に参加するよう制約された - [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)`構文への対応 @@ -306,3 +306,5 @@ p8 : (X(1 2 3),Y(4 5)) - 参照型を要素に持つ場合にダングリング参照が容易に作成できていたのを不適格にする - [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)として使用できるようにする +- [LWG Issue 2367. `pair` and `tuple` are not correctly implemented for `is_constructible` with no args](https://cplusplus.github.io/LWG/issue2367) + - C++17で、デフォルトコンストラクタ(1)が、いずれかの要素型がデフォルト構築可能でない場合はオーバーロード解決に参加しないよう制約化された diff --git a/reference/utility/swap.md b/reference/utility/swap.md index 369a23856e..7dc67b0c76 100644 --- a/reference/utility/swap.md +++ b/reference/utility/swap.md @@ -162,3 +162,5 @@ int main() - [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で、配列に対するオーバーロードが追加された経緯のレポート - [P0879R0 Constexpr for `swap` and `swap` related functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0879r0.html) +- [LWG Issue 1349. `swap` should not throw](https://cplusplus.github.io/LWG/issue1349) + - C++11の策定時に、ドラフト段階で無条件`noexcept`となっていたものが、条件付きの形 (`noexcept(see below)`) へ修正された From 251aaef370137b9f36e6e9b202afadbd22d6a9bc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:50:38 +0900 Subject: [PATCH 125/147] =?UTF-8?q?cfenv=20:=20LWG=20Issue=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/cfenv.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/cfenv.md b/reference/cfenv.md index b0c0e2bb54..68d182ec6c 100644 --- a/reference/cfenv.md +++ b/reference/cfenv.md @@ -87,3 +87,8 @@ ## 関連項目 - [``](/reference/cmath.md) + + +## 参照 +- [LWG Issue 860. Floating-Point State](https://cplusplus.github.io/LWG/issue860) + - C++11で、浮動小数点環境がスレッドごとに保持され、各関数は呼び出し元スレッドの環境にアクセスすることが規定された From 85326675b55136fb3d68e29df841ae7a8d63b048 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:51:27 +0900 Subject: [PATCH 126/147] =?UTF-8?q?cinttypes=20:=20=E3=81=93=E3=81=AE?= =?UTF-8?q?=E3=83=98=E3=83=83=E3=83=80=E3=81=AB=E5=90=AB=E3=81=BE=E3=82=8C?= =?UTF-8?q?=E3=82=8B=E3=83=9E=E3=82=AF=E3=83=AD=E3=81=8C=E7=84=A1=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E3=81=AB=E6=8F=90=E4=BE=9B=E3=81=95=E3=82=8C=E3=82=8B?= =?UTF-8?q?=E3=81=AE=E3=81=A8=E3=80=81=5F=5FSTDC=5FFORMAT=5FMACROS?= =?UTF-8?q?=E3=81=8CC++=E3=81=A7=E5=8A=B9=E6=9E=9C=E3=82=92=E3=82=82?= =?UTF-8?q?=E3=81=9F=E3=81=AA=E3=81=84=E3=81=93=E3=81=A8=E3=81=8C=E8=A8=98?= =?UTF-8?q?=E8=BC=89=E3=81=95=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cinttypes.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reference/cinttypes.md b/reference/cinttypes.md index b5319ab969..e0c1d0def5 100644 --- a/reference/cinttypes.md +++ b/reference/cinttypes.md @@ -52,6 +52,10 @@ | `SCNdMAX` 等, `SCNdPTR` 等 | `intmax_t` / `intptr_t`系用 | C++11 | +## 備考 +- このヘッダが定義するマクロは、無条件に提供される。C言語で書式指定マクロの提供を制御する`__STDC_FORMAT_MACROS`は、C++では何の役割も持たない。 + + ## バージョン情報マクロ | 名前 | 説明 | 対応バージョン | @@ -73,3 +77,7 @@ - [N1568 Proposed additions to TR-1 to improve compatibility with C99](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm) - [P3348R4 C++26 should refer to C23 not C17](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3348r4.pdf) - C++26がC23を参照するようになり、2進数用の書式指定マクロ (`PRIb`*N*・`PRIB`*N*・`SCNb`*N*等) と`__STDC_VERSION_INTTYPES_H__`が追加された +- [LWG Issue 984. Does `` have macro guards?](https://cplusplus.github.io/LWG/issue984) + - C++11で、このヘッダのマクロは無条件に提供され、C99の`__STDC_FORMAT_MACROS`はC++では何の役割も持たない旨の注記が追加された +- [LWG Issue 1449. Incomplete specification of header ``](https://cplusplus.github.io/LWG/issue1449) + - C++11で、このヘッダの内容が``との差分として規定された。このヘッダが``をインクルードすることや、[`intmax_t`](/reference/cstdint/intmax_t.md)が拡張整数型である場合に[`abs()`](/reference/cstdlib/abs.md)と`div()`のオーバーロードが追加されることが明記された From 0ab338f5548496fadb6657734f8edf4aa66385f4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:51:57 +0900 Subject: [PATCH 127/147] =?UTF-8?q?vector=20:=20LWG=20Issue=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/vector/vector.md | 2 ++ reference/vector/vector/back.md | 2 ++ reference/vector/vector/data.md | 4 +++- reference/vector/vector/insert.md | 4 +++- reference/vector/vector/op_constructor.md | 4 ++++ reference/vector/vector/swap.md | 2 ++ 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/reference/vector/vector.md b/reference/vector/vector.md index 6e6aa8d195..fd64f2103f 100644 --- a/reference/vector/vector.md +++ b/reference/vector/vector.md @@ -458,3 +458,5 @@ int main() - C++23から、Range・コンテナ、`pair`、`tuple`のフォーマット出力、および文字・文字列のデバッグ指定 (`"?"`) が追加された - [P3612R1 Harmonize proxy-reference operations (LWG 3638 and 4187)](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3612r1.html) - C++26で、`vector::reference`にADLで見つかる非メンバ`swap`関数が追加され、従来の`static`メンバ関数版`swap`が非推奨となった +- [LWG Issue 814. `vector::swap(reference, reference)` not defined](https://cplusplus.github.io/LWG/issue814) + - C++11で、`vector::reference`同士を交換する静的メンバ関数`swap()`の効果が規定された。宣言のみで意味が規定されていなかった diff --git a/reference/vector/vector/back.md b/reference/vector/vector/back.md index 54cf01258c..3a7290c786 100644 --- a/reference/vector/vector/back.md +++ b/reference/vector/vector/back.md @@ -58,3 +58,5 @@ int main() ## 参照 - [P1004R2 Making `std::vector` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1004r2.pdf) +- [LWG Issue 1039. Sequence container `back` function should also support `const_iterator`](https://cplusplus.github.io/LWG/issue1039) + - C++11で、要件表における`back()`の説明が`iterator`を使うものから`auto`を使うものへ改められた。`const`なコンテナでは`end()`が`const_iterator`を返すため、`iterator`と書くと`const`版の説明として成立しなかった diff --git a/reference/vector/vector/data.md b/reference/vector/vector/data.md index 87a8698a5c..a3eb797949 100644 --- a/reference/vector/vector/data.md +++ b/reference/vector/vector/data.md @@ -73,6 +73,8 @@ gcc 4.8.2 の時点で libstdc++ の実装にはバグがあり、`vector` が ## 参照 - [LWG Issue 464. Suggestion for new member functions in standard containers](https://wg21.cmeerw.net/lwg/issue464) -- [LWG Issue 2596. `vector::data()` should use addressof](https://wg21.cmeerw.net/lwg/issue2596) +- [LWG Issue 1312. `vector::data` no longer returns a raw pointer](https://cplusplus.github.io/LWG/issue1312) + - C++11で、戻り値の型が`pointer`から`T*`へ改められた。アロケータが独自のポインタ型を持つ場合でも、生ポインタが返ることを保証するため - [[gcc] Revision 207241](https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=207241) - [P1004R2 Making `std::vector` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1004r2.pdf) +- [LWG Issue 2596. `vector::data()` should use addressof](https://wg21.cmeerw.net/lwg/issue2596) diff --git a/reference/vector/vector/insert.md b/reference/vector/vector/insert.md index 4827352c43..679b5beab8 100644 --- a/reference/vector/vector/insert.md +++ b/reference/vector/vector/insert.md @@ -182,6 +182,8 @@ 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) - (5)の経緯となる提案文書 +- [LWG Issue 149. Insert should return iterator to first element inserted](https://cplusplus.github.io/LWG/issue149) + - C++11で、複数要素を挿入するオーバーロードの戻り値が`void`から`iterator`へ変更され、挿入された最初の要素を指すイテレータを返すようになった。挿入位置を指すイテレータは挿入によって無効化されうるため、`void`では挿入結果を参照する手段がなかった +- [P1004R2 Making `std::vector` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1004r2.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)ページを参照。 -- [P1004R2 Making `std::vector` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1004r2.pdf) diff --git a/reference/vector/vector/op_constructor.md b/reference/vector/vector/op_constructor.md index 5bc77cf752..86bdfb4e59 100644 --- a/reference/vector/vector/op_constructor.md +++ b/reference/vector/vector/op_constructor.md @@ -207,3 +207,7 @@ sixth : {1 2 3 } - C++23でのアロケータ引数を`type_identity_t`で包む変更 - [P2846R6 `reserve_hint`: Eagerly reserving memory for not-quite-sized lazy ranges](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2846r6.pdf) - C++26で、(11) Range版コンストラクタが[`ranges::approximately_sized_range`](../../ranges/approximately_sized_range.md)の要素数近似値を利用して再確保を回避するよう変更 +- [LWG Issue 1234. "Do the right thing" and NULL](https://cplusplus.github.io/LWG/issue1234) + - C++11で、イテレータ範囲を受け取るオーバーロードの扱いが、`InputIterator`が整数型の場合に要素数と値を受け取るオーバーロードと等価とみなす規定から、入力イテレータの要件を満たさない場合はオーバーロード解決に参加しないという制約へ改められた +- [LWG Issue 1284. `vector` `initializer_list` constructor missing an allocator argument](https://cplusplus.github.io/LWG/issue1284) + - C++11で、`vector`の特殊化における初期化子リストのコンストラクタにも、アロケータの引数が追加された diff --git a/reference/vector/vector/swap.md b/reference/vector/vector/swap.md index a26daf1adc..06d75042cd 100644 --- a/reference/vector/vector/swap.md +++ b/reference/vector/vector/swap.md @@ -77,3 +77,5 @@ v2 : {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) +- [LWG Issue 765. More on iterator validity](https://cplusplus.github.io/LWG/issue765) + - C++11で、`swap()`が参照・ポインタ・イテレータを無効化しないという要件に対して、「`end()`が返すイテレータはどの要素も指していないため、無効化されることがある」という注記が追加された From 571dc698c54528baba8f1fab0d1a45996c06e13c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:57:28 +0900 Subject: [PATCH 128/147] =?UTF-8?q?vector::resize=20:=20=E3=82=B5=E3=82=A4?= =?UTF-8?q?=E3=82=BA=E3=81=8C=E5=A4=89=E3=82=8F=E3=82=89=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=81=AB=E3=81=AA=E3=81=AB=E3=82=82=E3=81=97?= =?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/vector/vector/resize.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/reference/vector/vector/resize.md b/reference/vector/vector/resize.md index 4c4b3904d3..3419121b0e 100644 --- a/reference/vector/vector/resize.md +++ b/reference/vector/vector/resize.md @@ -34,7 +34,8 @@ void resize(size_type sz, T c = T()); // (1) + (2) C++98 - C++11まで : [`erase`](erase.md)`(`[`begin()`](begin.md) `+ sz,` [`end()`](end.md)`);` - C++14 : [`pop_back()`](pop_back.md)関数を[`size()`](size.md) `- sz`回呼ぶ - C++17以降 : 後ろから[`size()`](size.md) `- sz`個の要素を削除する - - もし`sz`が現在のコンテナの[`size()`](size.md)より大きい場合、`sz -` [`size()`](size.md)個だけ値初期化された`T`型オブジェクトのコピーを追加する。 + - そうでない場合、`sz -` [`size()`](size.md)個だけ値初期化された`T`型オブジェクトのコピーを追加する。 + - `sz ==` [`size()`](size.md)である場合、追加される要素は`0`個であり、コンテナは変更されない。 - (2) : @@ -110,7 +111,11 @@ int main() ## 参照 +- [LWG Issue 868. Default construction and value-initialization](https://cplusplus.github.io/LWG/issue868) + - C++11の策定時に、値を指定しない`resize(sz)`の要素追加が「デフォルト構築」から「値初期化」へ改められた。ドラフト段階の文言では組み込み型の要素が未初期化になりうるものだったため(値を指定するC++98の`resize(sz, T())`とは挙動は変わらない) +- [LWG Issue 1525. Effects of `resize(size())` on a `vector`](https://cplusplus.github.io/LWG/issue1525) + - C++11で、効果の条件が`sz <= size()`へ修正された。C++11のドラフトでは`sz < size()`と`size() < sz`のみが規定されており、`sz == size()`の場合の効果が規定されていなかったため(C++98では`else ; // do nothing`と明記されていた)。なお現在の規格では、`sz < size()`でない場合に`sz - size()`個(`sz == size()`なら`0`個)を追加すると規定されており、どの版でも`sz == size()`ならコンテナは変更されない - [LWG Issue 2033. Preconditions of `reserve`, `shrink_to_fit`, and `resize` functions](https://wg21.cmeerw.net/lwg/issue2033) -- [LWG Issue 2323. `vector::resize(n, t)`'s specification should be simplified](https://wg21.cmeerw.net/lwg/issue2323) -- [LWG Issue 2160. Unintended destruction ordering-specification of `resize`](https://wg21.cmeerw.net/lwg/issue2160) - [P1004R2 Making `std::vector` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1004r2.pdf) +- [LWG Issue 2160. Unintended destruction ordering-specification of `resize`](https://wg21.cmeerw.net/lwg/issue2160) +- [LWG Issue 2323. `vector::resize(n, t)`'s specification should be simplified](https://wg21.cmeerw.net/lwg/issue2323) From aa5a7e0c4232f6d02ea05e065460044fbf60aebc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:57:54 +0900 Subject: [PATCH 129/147] =?UTF-8?q?deque=20:=20LWG=20Issue=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/deque/deque/back.md | 2 ++ reference/deque/deque/insert.md | 4 +++- reference/deque/deque/op_constructor.md | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/reference/deque/deque/back.md b/reference/deque/deque/back.md index a67e69c9f7..3b1e769182 100644 --- a/reference/deque/deque/back.md +++ b/reference/deque/deque/back.md @@ -64,3 +64,5 @@ int main() ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 1039. Sequence container `back` function should also support `const_iterator`](https://cplusplus.github.io/LWG/issue1039) + - C++11で、要件表における`back()`の説明が`iterator`を使うものから`auto`を使うものへ改められた。`const`なコンテナでは`end()`が`const_iterator`を返すため、`iterator`と書くと`const`版の説明として成立しなかった diff --git a/reference/deque/deque/insert.md b/reference/deque/deque/insert.md index 256d15d1a0..51a6d03bfb 100644 --- a/reference/deque/deque/insert.md +++ b/reference/deque/deque/insert.md @@ -135,6 +135,8 @@ 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) - (5)の経緯となる提案文書 +- [LWG Issue 149. Insert should return iterator to first element inserted](https://cplusplus.github.io/LWG/issue149) + - C++11で、複数要素を挿入するオーバーロードの戻り値が`void`から`iterator`へ変更され、挿入された最初の要素を指すイテレータを返すようになった。挿入位置を指すイテレータは挿入によって無効化されうるため、`void`では挿入結果を参照する手段がなかった +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) - [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/op_constructor.md b/reference/deque/deque/op_constructor.md index 8c11a3f7e1..cdeca13198 100644 --- a/reference/deque/deque/op_constructor.md +++ b/reference/deque/deque/op_constructor.md @@ -237,3 +237,5 @@ c7 : {1 2 3 } - [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) +- [LWG Issue 1234. "Do the right thing" and NULL](https://cplusplus.github.io/LWG/issue1234) + - C++11で、イテレータ範囲を受け取るオーバーロードの扱いが、`InputIterator`が整数型の場合に要素数と値を受け取るオーバーロードと等価とみなす規定から、入力イテレータの要件を満たさない場合はオーバーロード解決に参加しないという制約へ改められた From 66b4ed3aa7bcffbaf98e18adaf160177b6d11cf5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:58:35 +0900 Subject: [PATCH 130/147] =?UTF-8?q?deque::swap=20:=20=E7=B5=82=E7=AB=AF?= =?UTF-8?q?=E3=82=A4=E3=83=86=E3=83=AC=E3=83=BC=E3=82=BF=E3=81=8C=E7=84=A1?= =?UTF-8?q?=E5=8A=B9=E3=81=AB=E3=81=AA=E3=82=8B=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/deque/deque/swap.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reference/deque/deque/swap.md b/reference/deque/deque/swap.md index 1500db426c..43ee4a4457 100644 --- a/reference/deque/deque/swap.md +++ b/reference/deque/deque/swap.md @@ -32,7 +32,8 @@ constexpr void ## 備考 -swapされるコンテナの要素を指す参照、ポインタ、イテレータを無効化しない。 +- swapされるコンテナの要素を指す参照、ポインタ、イテレータを無効化しない。 + - ただし、[`end()`](end.md)が指すイテレータはどの要素も指していないが、無効になることがある。 ## 例 @@ -75,3 +76,5 @@ 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) +- [LWG Issue 765. More on iterator validity](https://cplusplus.github.io/LWG/issue765) + - C++11で、`swap()`が参照・ポインタ・イテレータを無効化しないという要件に対して、「`end()`が返すイテレータはどの要素も指していないため、無効化されることがある」という注記が追加された From 49800c4c3a46dcdbb15ce2c7162780f4ae16a533 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:59:17 +0900 Subject: [PATCH 131/147] =?UTF-8?q?deque::resize=20:=20=E3=82=B5=E3=82=A4?= =?UTF-8?q?=E3=82=BA=E3=81=8C=E5=A4=89=E3=82=8F=E3=82=89=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=81=AB=E3=81=AA=E3=81=AB=E3=82=82=E3=81=97?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=81=93=E3=81=A8=E3=81=8C=E8=A8=98=E8=BC=89?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/deque/deque/resize.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/reference/deque/deque/resize.md b/reference/deque/deque/resize.md index 6f47b432d9..20e61000e4 100644 --- a/reference/deque/deque/resize.md +++ b/reference/deque/deque/resize.md @@ -34,7 +34,8 @@ void resize(size_type sz, const T& c = T()); // (1) + (2) : C++98まで - C++11まで : [`erase`](erase.md)`(`[`begin()`](begin.md) `+ sz,` [`end()`](end.md)`);` - C++14 : [`pop_back()`](pop_back.md)関数を[`size()`](size.md) `- sz`回呼ぶ - C++17 : 後ろから[`size()`](size.md) `- sz`個の要素を削除する - - もし`sz`が現在のコンテナの[`size()`](size.md)より大きい場合、`sz -` [`size()`](size.md)個だけ値初期化された`T`型オブジェクトのコピーを追加する。 + - そうでない場合、`sz -` [`size()`](size.md)個だけ値初期化された`T`型オブジェクトのコピーを追加する。 + - `sz ==` [`size()`](size.md)である場合、追加される要素は`0`個であり、コンテナは変更されない。 - (2) : @@ -106,9 +107,13 @@ int main() ``` ## 参照 +- [LWG Issue 868. Default construction and value-initialization](https://cplusplus.github.io/LWG/issue868) + - C++11の策定時に、値を指定しない`resize(sz)`の要素追加が「デフォルト構築」から「値初期化」へ改められた。ドラフト段階の文言では組み込み型の要素が未初期化になりうるものだったため(値を指定するC++98の`resize(sz, T())`とは挙動は変わらない) +- [LWG Issue 1418. Effects of `resize(size())` on a `deque`](https://cplusplus.github.io/LWG/issue1418) + - C++11で、効果の条件が`sz <= size()`へ修正された。C++11のドラフトでは`sz < size()`と`size() < sz`のみが規定されており、`sz == size()`の場合の効果が規定されていなかったため(C++98では`else ; // do nothing`と明記されていた)。なお現在の規格では、`sz < size()`でない場合に`sz - size()`個(`sz == size()`なら`0`個)を追加すると規定されており、どの版でも`sz == size()`ならコンテナは変更されない - [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) +- [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) - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) From 0e56ec55594960925fb9348d59bdd8f02cb8a2ef Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:59:36 +0900 Subject: [PATCH 132/147] =?UTF-8?q?forward=5Flist=20:=20LWG=20Issue?= =?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/forward_list/forward_list/before_begin.md | 2 ++ reference/forward_list/forward_list/erase_after.md | 2 ++ reference/forward_list/forward_list/insert_after.md | 4 ++++ reference/forward_list/forward_list/merge.md | 6 +++++- reference/forward_list/forward_list/op_constructor.md | 4 ++++ reference/forward_list/forward_list/remove.md | 2 ++ reference/forward_list/forward_list/resize.md | 4 ++++ reference/forward_list/forward_list/splice_after.md | 4 +++- 8 files changed, 26 insertions(+), 2 deletions(-) diff --git a/reference/forward_list/forward_list/before_begin.md b/reference/forward_list/forward_list/before_begin.md index e228a58d2d..5c26541bbb 100644 --- a/reference/forward_list/forward_list/before_begin.md +++ b/reference/forward_list/forward_list/before_begin.md @@ -78,3 +78,5 @@ int main() ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 2042. Comparing `forward_list::before_begin()` to `forward_list::end()`](https://cplusplus.github.io/LWG/issue2042) + - C++11で、`before_begin() == end()`が`false`となることと、`cbefore_begin()`が`const`版の`before_begin()`と等価であることが規定された diff --git a/reference/forward_list/forward_list/erase_after.md b/reference/forward_list/forward_list/erase_after.md index 127ff9e18d..f67bf7e838 100644 --- a/reference/forward_list/forward_list/erase_after.md +++ b/reference/forward_list/forward_list/erase_after.md @@ -147,3 +147,5 @@ int main() ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 1416. `forward_list::erase_after` should not be allowed to throw](https://cplusplus.github.io/LWG/issue1416) + - C++11で、この関数が例外を送出しないことが規定された diff --git a/reference/forward_list/forward_list/insert_after.md b/reference/forward_list/forward_list/insert_after.md index 6c467b0e37..c034eef0a5 100644 --- a/reference/forward_list/forward_list/insert_after.md +++ b/reference/forward_list/forward_list/insert_after.md @@ -175,6 +175,10 @@ 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) +- [LWG Issue 878. `forward_list` preconditions](https://cplusplus.github.io/LWG/issue878) + - C++11で、`position`の事前条件が「デリファレンス可能、もしくは`before_begin()`と等しい」から「`before_begin()`であるか、範囲`[begin(), end())`のデリファレンス可能なイテレータ」へ改められた。他の`forward_list`オブジェクトのイテレータを渡す誤用を排除するため +- [LWG Issue 1278. Inconsistent return values for `forward_list::insert_after`](https://cplusplus.github.io/LWG/issue1278) + - C++11で、複数要素を挿入するオーバーロードの戻り値が`position`から「最後に挿入された要素を指すイテレータ」へ変更された。挿入した範囲の末尾を知る手段がなく、続けて挿入する用途で使いづらかったため - [LWG Issue 3817. Missing preconditions on `forward_list` modifiers](https://cplusplus.github.io/LWG/issue3817) - C++23で、各オーバーロードに要素型`T`の挿入可能性(`CopyInsertable`/`MoveInsertable`/`EmplaceConstructible`)に関する事前条件が追加された - [LWG Issue 4164. Missing guarantees for `forward_list` modifiers](https://cplusplus.github.io/LWG/issue4164) diff --git a/reference/forward_list/forward_list/merge.md b/reference/forward_list/forward_list/merge.md index 261a3a2233..7adacdc602 100644 --- a/reference/forward_list/forward_list/merge.md +++ b/reference/forward_list/forward_list/merge.md @@ -105,9 +105,13 @@ int main() - 2010は、`&`バージョン(1)と(3)のみ実装されている。 ## 参照 +- [LWG Issue 898. Small contradiction in `n2723` to forward to committee](https://cplusplus.github.io/LWG/issue898) + - C++11で、計算量の記述が`size() + x.size()`から`distance(begin(), end()) + distance(x.begin(), x.end())`へ改められた。[`forward_list`](../forward_list.md)は`size()`メンバ関数を持たないため +- [LWG Issue 1310. `forward_list` `splice_after` from lvalues](https://cplusplus.github.io/LWG/issue1310) + - C++11で、左辺値の[`forward_list`](../forward_list.md)を受け取るオーバーロードが追加された。右辺値参照版しかないと、名前を持つオブジェクトから移動する際に[`std::move`](/reference/utility/move.md)が必要だった - [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) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) - [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) - [LWG Issue 3088. `forward_list::merge` behavior unclear when passed `*this`](https://cplusplus.github.io/LWG/issue3088) - C++23で、`x`が`*this`自身である場合は何もしないことが明確化された diff --git a/reference/forward_list/forward_list/op_constructor.md b/reference/forward_list/forward_list/op_constructor.md index 8d364bd6c3..0e77b6265b 100644 --- a/reference/forward_list/forward_list/op_constructor.md +++ b/reference/forward_list/forward_list/op_constructor.md @@ -240,3 +240,7 @@ ls7 : 1 2 3 - [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) +- [LWG Issue 1234. "Do the right thing" and NULL](https://cplusplus.github.io/LWG/issue1234) + - C++11で、イテレータ範囲を受け取るオーバーロードの扱いが、`InputIterator`が整数型の場合に要素数と値を受け取るオーバーロードと等価とみなす規定から、入力イテレータの要件を満たさない場合はオーバーロード解決に参加しないという制約へ改められた +- [LWG Issue 1276. forwardlist missing allocator constructors](https://cplusplus.github.io/LWG/issue1276) + - C++11で、アロケータを指定するコピーコンストラクタとムーブコンストラクタが追加された。ほかのコンテナには用意されていたが、記載が漏れていた diff --git a/reference/forward_list/forward_list/remove.md b/reference/forward_list/forward_list/remove.md index 8ecfe974e8..e1533a3887 100644 --- a/reference/forward_list/forward_list/remove.md +++ b/reference/forward_list/forward_list/remove.md @@ -72,3 +72,5 @@ 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) +- [LWG Issue 1207. Underspecified `std::list` operations?](https://cplusplus.github.io/LWG/issue1207) + - C++11で、削除された要素を指すイテレータと参照のみが無効になることが明記された diff --git a/reference/forward_list/forward_list/resize.md b/reference/forward_list/forward_list/resize.md index 9abc6a05a5..43d8832646 100644 --- a/reference/forward_list/forward_list/resize.md +++ b/reference/forward_list/forward_list/resize.md @@ -88,3 +88,7 @@ int main() ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 868. Default construction and value-initialization](https://cplusplus.github.io/LWG/issue868) + - C++11の策定時に、値を指定しない`resize(sz)`の要素追加が「デフォルト構築」から「値初期化」へ改められた。ドラフト段階の文言では組み込み型の要素が未初期化になりうるものだったため(値を指定するC++98の`resize(sz, T())`とは挙動は変わらない) +- [LWG Issue 1340. Why does `forward_list::resize` take the object to be copied by value?](https://cplusplus.github.io/LWG/issue1340) + - C++11で、値を指定するオーバーロードの引数型が`value_type`から`const value_type&`へ改められた。ほかのコンテナと扱いを揃え、不要なコピーを避けるため diff --git a/reference/forward_list/forward_list/splice_after.md b/reference/forward_list/forward_list/splice_after.md index b9b2108474..e47a8a03ab 100644 --- a/reference/forward_list/forward_list/splice_after.md +++ b/reference/forward_list/forward_list/splice_after.md @@ -167,8 +167,10 @@ int main() ## 参照 +- [LWG Issue 1310. `forward_list` `splice_after` from lvalues](https://cplusplus.github.io/LWG/issue1310) + - C++11で、左辺値の`forward_list`を受け取るオーバーロードが追加された。右辺値参照版しかないと、名前を持つオブジェクトから移動する際に[`std::move`](/reference/utility/move.md)が必要だった - [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 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) +- [LWG Issue 3017. `list` `splice` functions should use `addressof`](https://wg21.cmeerw.net/lwg/issue3017) From 0710c447a747f6cbf198aed3c8c6eeccfe82ff34 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 13:59:55 +0900 Subject: [PATCH 133/147] =?UTF-8?q?list=20:=20LWG=20Issue=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/list/list/back.md | 2 ++ reference/list/list/insert.md | 2 ++ reference/list/list/op_constructor.md | 2 ++ 3 files changed, 6 insertions(+) diff --git a/reference/list/list/back.md b/reference/list/list/back.md index 97e39b510d..403b8adc13 100644 --- a/reference/list/list/back.md +++ b/reference/list/list/back.md @@ -49,3 +49,5 @@ int main() ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 1039. Sequence container `back` function should also support `const_iterator`](https://cplusplus.github.io/LWG/issue1039) + - C++11で、要件表における`back()`の説明が`iterator`を使うものから`auto`を使うものへ改められた。`const`なコンテナでは`end()`が`const_iterator`を返すため、`iterator`と書くと`const`版の説明として成立しなかった diff --git a/reference/list/list/insert.md b/reference/list/list/insert.md index 699a1098e5..7a921e56de 100644 --- a/reference/list/list/insert.md +++ b/reference/list/list/insert.md @@ -167,3 +167,5 @@ 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) +- [LWG Issue 149. Insert should return iterator to first element inserted](https://cplusplus.github.io/LWG/issue149) + - C++11で、複数要素を挿入するオーバーロードの戻り値が`void`から`iterator`へ変更され、挿入された最初の要素を指すイテレータを返すようになった。挿入位置を指すイテレータは挿入によって無効化されうるため、`void`では挿入結果を参照する手段がなかった diff --git a/reference/list/list/op_constructor.md b/reference/list/list/op_constructor.md index ecbe0ef993..0323ba6507 100644 --- a/reference/list/list/op_constructor.md +++ b/reference/list/list/op_constructor.md @@ -222,3 +222,5 @@ ls7 : 1 2 3 - [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) +- [LWG Issue 1234. "Do the right thing" and NULL](https://cplusplus.github.io/LWG/issue1234) + - C++11で、イテレータ範囲を受け取るオーバーロードの扱いが、`InputIterator`が整数型の場合に要素数と値を受け取るオーバーロードと等価とみなす規定から、入力イテレータの要件を満たさない場合はオーバーロード解決に参加しないという制約へ改められた From bee48b447f77d9627fdc0e172e7ca9ff0fb27080 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 14:00:38 +0900 Subject: [PATCH 134/147] =?UTF-8?q?list::merge=20:=20=E8=87=AA=E8=BA=AB?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E3=81=97=E3=81=A6=E3=81=AF=E3=81=AA=E3=81=AB?= =?UTF-8?q?=E3=82=82=E3=81=97=E3=81=AA=E3=81=84=E3=81=93=E3=81=A8=E3=81=8C?= =?UTF-8?q?=E6=98=8E=E8=A8=98=E3=81=95=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/list/list/merge.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reference/list/list/merge.md b/reference/list/list/merge.md index 3fb9c25c57..851fd4ba08 100644 --- a/reference/list/list/merge.md +++ b/reference/list/list/merge.md @@ -35,8 +35,9 @@ constexpr void ## 効果 -`x`を`*this`にマージする。2つの`list`オブジェクトの要素を`*this`に併合し、`x`はマージ後に空となる。 -マージ後、`x`の要素に対するイテレータおよび参照は無効にならない。 +- [`addressof`](/reference/memory/addressof.md)`(x) == this`である場合、何もしない。 +- そうでない場合、`x`を`*this`にマージする。2つの`list`オブジェクトの要素を`*this`に併合し、`x`はマージ後に空となる。 +- マージ後、`x`の要素に対するイテレータおよび参照は無効にならない。 ## 戻り値 @@ -90,3 +91,5 @@ int main() ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 1215. `list::merge` with unequal allocators](https://cplusplus.github.io/LWG/issue1215) + - C++11で、`&x == this`である場合は何もしないことが明記され、アロケータが等値でない場合の動作は未定義であることが規定された From 32783f376518cb29bde5bb2e8f513c9bb5d64269 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 14:01:40 +0900 Subject: [PATCH 135/147] =?UTF-8?q?list::resize=20:=20list=E3=81=A7?= =?UTF-8?q?=E3=81=AF=20new=5Fsize=20<=3D=20size=E3=81=AE=E3=81=A8=E3=81=8D?= =?UTF-8?q?=E3=81=AB=E8=B6=85=E9=81=8E=E8=A6=81=E7=B4=A0=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4=E3=81=99=E3=82=8B=E4=BB=95=E6=A7=98=E3=81=A0=E3=81=A3?= =?UTF-8?q?=E3=81=9F=20(=E3=82=B5=E3=82=A4=E3=82=BA=E3=81=8C=E5=A4=89?= =?UTF-8?q?=E3=82=8F=E3=82=89=E3=81=AA=E3=81=8F=E3=81=A6=E3=82=82)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/list/list/resize.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reference/list/list/resize.md b/reference/list/list/resize.md index c951c03c6e..564e617e2d 100644 --- a/reference/list/list/resize.md +++ b/reference/list/list/resize.md @@ -23,7 +23,7 @@ void resize(size_type sz, T c = T()); // (1) + (2) C++98。C ## 効果 -`sz`がコンテナの要素数より小さい場合、後ろから超過している要素を削除する。 +`sz`がコンテナの要素数以下の場合、後ろから超過している要素を削除する。 `sz`がコンテナの要素数より大きい場合、不足している分だけ末尾に要素を挿入する。挿入する要素の値を指定しない場合(つまり1引数版を使用する場合)、値初期化された`T`型の値が挿入される。2引数版の場合は、値`c`のコピーが挿入される。 @@ -75,3 +75,7 @@ int main() ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 868. Default construction and value-initialization](https://cplusplus.github.io/LWG/issue868) + - C++11の策定時に、値を指定しない`resize(sz)`の要素追加が「デフォルト構築」から「値初期化」へ改められた。ドラフト段階の文言では組み込み型の要素が未初期化になりうるものだったため(値を指定するC++98の`resize(sz, T())`とは挙動は変わらない) +- [LWG Issue 1420. Effects of `resize(size())` on a `list`](https://cplusplus.github.io/LWG/issue1420) + - C++11で、効果の条件が`sz <= size()`へ修正された。C++11のドラフトでは`sz < size()`と`size() < sz`のみが規定されており、`sz == size()`の場合の効果が規定されていなかったため。この条件は現在の規格でも`sz <= size()`のままである(`sz == size()`の場合、削除される要素は`0`個となる) From 679c8664a6956073428b6137c9500b881f851c04 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 14:02:03 +0900 Subject: [PATCH 136/147] =?UTF-8?q?list::swap=20:=20=E7=B5=82=E7=AB=AF?= =?UTF-8?q?=E3=82=A4=E3=83=86=E3=83=AC=E3=83=BC=E3=82=BF=E3=81=8C=E7=84=A1?= =?UTF-8?q?=E5=8A=B9=E3=81=AB=E3=81=AA=E3=82=8B=E3=81=93=E3=81=A8=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/list/list/swap.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/list/list/swap.md b/reference/list/list/swap.md index f8ccbda970..9f86944b45 100644 --- a/reference/list/list/swap.md +++ b/reference/list/list/swap.md @@ -31,6 +31,11 @@ constexpr void 定数時間 +## 備考 +- swapされるコンテナの要素を指す参照、ポインタ、イテレータを無効化しない。 + - ただし、[`end()`](end.md)が指すイテレータはどの要素も指していないが、無効になることがある。 + + ## 例 ```cpp example #include @@ -71,3 +76,5 @@ 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) +- [LWG Issue 765. More on iterator validity](https://cplusplus.github.io/LWG/issue765) + - C++11で、`swap()`が参照・ポインタ・イテレータを無効化しないという要件に対して、「`end()`が返すイテレータはどの要素も指していないため、無効化されることがある」という注記が追加された From 3cb42689982c7167aecbb52df4c159d70efe4afc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 14:02:35 +0900 Subject: [PATCH 137/147] =?UTF-8?q?basic=5Fstring=20:=20LWG=20Issue?= =?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/string/basic_string/back.md | 2 ++ reference/string/basic_string/c_str.md | 2 ++ reference/string/basic_string/cbegin.md | 2 ++ reference/string/basic_string/cend.md | 2 ++ reference/string/basic_string/crbegin.md | 2 ++ reference/string/basic_string/crend.md | 2 ++ reference/string/basic_string/op_at.md | 2 ++ reference/string/basic_string/op_constructor.md | 8 +++++--- reference/string/basic_string/op_plus.md | 2 ++ reference/string/basic_string/replace.md | 4 +++- reference/string/basic_string/size.md | 2 ++ 11 files changed, 26 insertions(+), 4 deletions(-) diff --git a/reference/string/basic_string/back.md b/reference/string/basic_string/back.md index 78249fa1f5..b0f84ce43c 100644 --- a/reference/string/basic_string/back.md +++ b/reference/string/basic_string/back.md @@ -50,3 +50,5 @@ o - [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) +- [LWG Issue 1039. Sequence container `back` function should also support `const_iterator`](https://cplusplus.github.io/LWG/issue1039) + - C++11で、要件表における`back()`の説明が`iterator`を使うものから`auto`を使うものへ改められた。`const`なコンテナでは`end()`が`const_iterator`を返すため、`iterator`と書くと`const`版の説明として成立しなかった diff --git a/reference/string/basic_string/c_str.md b/reference/string/basic_string/c_str.md index 2303686577..1cf0063277 100644 --- a/reference/string/basic_string/c_str.md +++ b/reference/string/basic_string/c_str.md @@ -80,5 +80,7 @@ Hello ## 参照 +- [LWG Issue 876. `basic_string` access operations should give stronger guarantees](https://cplusplus.github.io/LWG/issue876) + - C++11で、例外を送出しないことと計算量が定数時間であることが規定された - [LWG Issue 3131. `addressof` all the things](https://wg21.cmeerw.net/lwg/issue3131) - [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/cbegin.md b/reference/string/basic_string/cbegin.md index 3847abd901..8ab174dc72 100644 --- a/reference/string/basic_string/cbegin.md +++ b/reference/string/basic_string/cbegin.md @@ -48,3 +48,5 @@ h ## 参照 - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) +- [LWG Issue 1192. `basic_string` missing definitions for cbegin / cend / crbegin / crend](https://cplusplus.github.io/LWG/issue1192) + - C++11で、これらのメンバ関数が追加された。ほかのコンテナには追加されていたが、`basic_string`には記載が漏れていた diff --git a/reference/string/basic_string/cend.md b/reference/string/basic_string/cend.md index 0649edf6a1..7f95f57758 100644 --- a/reference/string/basic_string/cend.md +++ b/reference/string/basic_string/cend.md @@ -61,3 +61,5 @@ o ## 参照 - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) +- [LWG Issue 1192. `basic_string` missing definitions for cbegin / cend / crbegin / crend](https://cplusplus.github.io/LWG/issue1192) + - C++11で、これらのメンバ関数が追加された。ほかのコンテナには追加されていたが、`basic_string`には記載が漏れていた diff --git a/reference/string/basic_string/crbegin.md b/reference/string/basic_string/crbegin.md index 4337da5d98..da58c0f6ec 100644 --- a/reference/string/basic_string/crbegin.md +++ b/reference/string/basic_string/crbegin.md @@ -48,3 +48,5 @@ o ## 参照 - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) +- [LWG Issue 1192. `basic_string` missing definitions for cbegin / cend / crbegin / crend](https://cplusplus.github.io/LWG/issue1192) + - C++11で、これらのメンバ関数が追加された。ほかのコンテナには追加されていたが、`basic_string`には記載が漏れていた diff --git a/reference/string/basic_string/crend.md b/reference/string/basic_string/crend.md index 868e97a5a6..306e59cfc9 100644 --- a/reference/string/basic_string/crend.md +++ b/reference/string/basic_string/crend.md @@ -52,3 +52,5 @@ h ## 参照 - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) +- [LWG Issue 1192. `basic_string` missing definitions for cbegin / cend / crbegin / crend](https://cplusplus.github.io/LWG/issue1192) + - C++11で、これらのメンバ関数が追加された。ほかのコンテナには追加されていたが、`basic_string`には記載が漏れていた diff --git a/reference/string/basic_string/op_at.md b/reference/string/basic_string/op_at.md index e29a7f40ee..5201a73838 100644 --- a/reference/string/basic_string/op_at.md +++ b/reference/string/basic_string/op_at.md @@ -62,6 +62,8 @@ e ``` ## 参照 +- [LWG Issue 876. `basic_string` access operations should give stronger guarantees](https://cplusplus.github.io/LWG/issue876) + - C++11で、例外を送出しないことと計算量が定数時間であることが規定された - [LWG Issue 2475. Allow overwriting of `std::basic_string` terminator with `charT()` to allow cleaner interoperation with legacy APIs](https://cplusplus.github.io/LWG/issue2475) - C++17で、非const版(2)の`pos == size()`で返る参照に`charT()`を書き込むことが許可された(レガシーC APIとの相互運用のため) - この修正は欠陥報告(DR)であり、C++11以降に遡及して適用される。`charT()`以外の値を書き込んだ場合の未定義動作は維持されており、処理系はヌル終端文字を実際に保持しているため`charT()`の書き込みは当初から問題なく動作していた。要件の緩和であり、既存プログラムの意味は変わらないため diff --git a/reference/string/basic_string/op_constructor.md b/reference/string/basic_string/op_constructor.md index 851b5d230e..1eb1afa64c 100644 --- a/reference/string/basic_string/op_constructor.md +++ b/reference/string/basic_string/op_constructor.md @@ -254,22 +254,24 @@ s14 : Hello ## 参照 - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - (11)の経緯となる提案文書 +- [LWG Issue 1234. "Do the right thing" and NULL](https://cplusplus.github.io/LWG/issue1234) + - C++11で、イテレータ範囲を受け取るオーバーロードの扱いが、`InputIterator`が整数型の場合に要素数と値を受け取るオーバーロードと等価とみなす規定から、入力イテレータの要件を満たさない場合はオーバーロード解決に参加しないという制約へ改められた - [LWG Issue 2069. Inconsistent exception spec for `basic_string` move constructor](https://wg21.cmeerw.net/lwg/issue2069) - [LWG Issue 2193. Default constructors for standard library containers are explicit](https://wg21.cmeerw.net/lwg/issue2193) - `explicit basic_string(const Allocator& a = Allocator())` を 2 つのオーバーロードに分割するきっかけとなったレポート - [LWG Issue 2235. Undefined behavior without proper requirements on `basic_string` constructors](https://wg21.cmeerw.net/lwg/issue2235) - C++14で、(7)と(8)の要件を見直した。 -- [LWG Issue 2583. There is no way to supply an allocator for `basic_string(str, pos)`](https://wg21.cmeerw.net/lwg/issue2583) - [P0254R2 Integrating `std::string_view` and `std::string`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0254r2.pdf) - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) +- [LWG Issue 2583. There is no way to supply an allocator for `basic_string(str, pos)`](https://wg21.cmeerw.net/lwg/issue2583) - [LWG Issue 2742. Inconsistent string interface taking `string_view`](https://wg21.cmeerw.net/lwg/issue2742) - `string_view`から範囲を指定して構築する(15)を追加 - [LWG Issue 2946. LWG 2758's resolution missed further corrections](https://wg21.cmeerw.net/lwg/issue2946) - 意図しない暗黙変換防止のために`string_view`を受けるオーバーロード(14)の引数型を`const T&`に変更 -- [LWG Issue 3076. `basic_string` CTAD ambiguity](https://cplusplus.github.io/LWG/issue3076) - - C++20で、(8), (9)に`Allocator`がアロケータ要件を満たさない型の場合はオーバーロード解決に参加しないという制約が追加され、クラステンプレート実引数推論(CTAD)の曖昧性が解消された - [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&&`と範囲指定をとるコンストラクタ追加 +- [LWG Issue 3076. `basic_string` CTAD ambiguity](https://cplusplus.github.io/LWG/issue3076) + - C++20で、(8), (9)に`Allocator`がアロケータ要件を満たさない型の場合はオーバーロード解決に参加しないという制約が追加され、クラステンプレート実引数推論(CTAD)の曖昧性が解消された diff --git a/reference/string/basic_string/op_plus.md b/reference/string/basic_string/op_plus.md index 056ca84f32..52a9ac0f83 100644 --- a/reference/string/basic_string/op_plus.md +++ b/reference/string/basic_string/op_plus.md @@ -366,3 +366,5 @@ Hello, World! - [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`との連結が追加された +- [LWG Issue 1138. Unusual return value for `operator+`](https://cplusplus.github.io/LWG/issue1138) + - C++11の策定時に、右辺値を受け取るオーバーロードの戻り値型から`&&`が取り除かれ、値を返すようになった。ダングリング参照を返しうるため diff --git a/reference/string/basic_string/replace.md b/reference/string/basic_string/replace.md index 1b9073c834..cc27a41f1d 100644 --- a/reference/string/basic_string/replace.md +++ b/reference/string/basic_string/replace.md @@ -436,7 +436,9 @@ int main() - [LWG ISsue 2268. Setting a default argument in the declaration of a member function `assign` of `std::basic_string`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2268) - C++14から(2)のオーバーロードに、`n = npos`のデフォルト引数を追加。 - [P0254R2 Integrating `std::string_view` and `std::string`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0254r2.pdf) +- [LWG Issue 1323. `basic_string::replace` should use `const_iterator`](https://cplusplus.github.io/LWG/issue1323) + - C++11で、イテレータで範囲を指定するオーバーロードの引数型が`iterator`から`const_iterator`へ改められた。ほかのコンテナと扱いを揃えるため - [LWG Issue 2758. `std::string{}.assign("ABCDE", 0, 1)` is ambiguous](https://wg21.cmeerw.net/lwg/issue2758) +- [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) - [LWG Issue 2946. LWG 2758's resolution missed further corrections](https://wg21.cmeerw.net/lwg/issue2946) - 意図しない暗黙変換防止のために`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/string/basic_string/size.md b/reference/string/basic_string/size.md index b26942567c..25cfc52c17 100644 --- a/reference/string/basic_string/size.md +++ b/reference/string/basic_string/size.md @@ -53,4 +53,6 @@ int main() ``` ## 参照 +- [LWG Issue 876. `basic_string` access operations should give stronger guarantees](https://cplusplus.github.io/LWG/issue876) + - C++11で、例外を送出しないことが規定された - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) From a9fc7a96d1d1a1a2df94a0f980fd4d9c8c8fed6b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 14:02:48 +0900 Subject: [PATCH 138/147] =?UTF-8?q?basic=5Fstring=20:=20=E4=BE=8B=E5=A4=96?= =?UTF-8?q?=E5=AE=89=E5=85=A8=E6=80=A7=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/string/basic_string.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reference/string/basic_string.md b/reference/string/basic_string.md index 8e109c7fb7..83349bcd43 100644 --- a/reference/string/basic_string.md +++ b/reference/string/basic_string.md @@ -67,6 +67,10 @@ namespace std { - C++98からC++14までは、要件ではなく注記として述べられていた +## 例外安全性 +`basic_string`のメンバ関数および演算子が例外を送出した場合、そのメンバ関数・演算子は何の効果も持たない。また、[`erase()`](basic_string/erase.md)と[`pop_back()`](basic_string/pop_back.md)は例外を送出しない。 + + ## メンバ関数 ### 構築・破棄 @@ -308,9 +312,13 @@ int main() * s.data()[link basic_string/data.md] ## 参照 +- [LWG Issue 847. `string` exception safety guarantees](https://cplusplus.github.io/LWG/issue847) + - C++11で、メンバ関数・演算子が例外を送出した場合に何の効果も持たないこと、[`erase()`](basic_string/erase.md)と[`pop_back()`](basic_string/pop_back.md)が例外を送出しないことが、クラス全体に対する包括的な規定として追加された - [N2668 Concurrency Modifications to Basic String](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2668.htm) - C++11で、`basic_string`の仕様が、並行実行のパフォーマンスを考慮したものに変更された経緯の提案文書 - [P0254R2 Integrating `std::string_view` and `std::string`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0254r2.pdf) +- [LWG Issue 1170. String char-like types no longer PODs](https://cplusplus.github.io/LWG/issue1170) + - C++11で、`charT`に指定できる文字likeな型が、リテラル型から配列でないPOD型へ改められた - [LWG Issue 2861. `basic_string` should require that charT match `traits::char_type`](https://cplusplus.github.io/LWG/issue2861) - C++17で、`value_type`が`traits::char_type`ではなく`charT`として定義されるようになり、「`traits::char_type`は`charT`と同じ型である」という注記が規範的要件へ格上げされた - この修正は欠陥報告(DR)であり、C++98以降に遡及して適用される。修正前も注記で両者が同じ型であることが述べられており、`value_type`がどちらで定義されても観測できる違いはないため From 882ad306ba234ae611857906c53fc10f2365f254 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 14:03:08 +0900 Subject: [PATCH 139/147] =?UTF-8?q?basic=5Fstring::data=20:=20=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=81=94=E3=81=A8=E3=81=AE?= =?UTF-8?q?=E8=A8=88=E7=AE=97=E9=87=8F=E3=81=A8=E4=BE=8B=E5=A4=96=E4=BB=95?= =?UTF-8?q?=E6=A7=98=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/string/basic_string/data.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/reference/string/basic_string/data.md b/reference/string/basic_string/data.md index 76e3653cb7..24cc1a717e 100644 --- a/reference/string/basic_string/data.md +++ b/reference/string/basic_string/data.md @@ -29,7 +29,17 @@ constexpr charT* data() noexcept; // (2) C++20 ## 計算量 -- (1), (2) : 定数時間 +- (1) : + - C++98まで : 規定なし + - C++11から : 定数時間 +- (2) : 定数時間 + + +## 例外 +- (1) : + - C++98まで : 規定なし + - C++11から : 投げない +- (2) : 投げない ## 備考 @@ -83,6 +93,8 @@ Hello, world! ## 参照 +- [LWG Issue 876. `basic_string` access operations should give stronger guarantees](https://cplusplus.github.io/LWG/issue876) + - C++11で、例外を送出しないことと計算量が定数時間であることが規定された - [P0272R1 Give `std::string` a non-const `.data()` member function.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0272r1.html) - [LWG Issue 2760. non-`const` `basic_string::data` should not invalidate iterators](https://cplusplus.github.io/LWG/issue2760) - C++17の策定中に、P0272R1で追加された非const版`data()`が、参照・ポインタ・イテレータを無効化しない関数の一覧に含まれていなかった記載漏れが修正された From 2c6bcf1047fae9762d5623fe9ccbbfdcddba8d4b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 14:29:14 +0900 Subject: [PATCH 140/147] =?UTF-8?q?basic=5Fstring::swap=20:=20=E7=B5=82?= =?UTF-8?q?=E7=AB=AF=E3=82=A4=E3=83=86=E3=83=AC=E3=83=BC=E3=82=BF=E3=81=8C?= =?UTF-8?q?=E7=84=A1=E5=8A=B9=E3=81=AB=E3=81=AA=E3=82=8B=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E6=80=A7=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/string/basic_string/swap.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/string/basic_string/swap.md b/reference/string/basic_string/swap.md index 73f648f32e..f70624b635 100644 --- a/reference/string/basic_string/swap.md +++ b/reference/string/basic_string/swap.md @@ -30,6 +30,11 @@ constexpr void swap(basic_string& str) noexcept 定数時間 +## 備考 +- swapされるコンテナの要素を指す参照、ポインタ、イテレータを無効化しない。 + - ただし、[`end()`](end.md)が指すイテレータはどの要素も指していないが、無効になることがある。 + + ## 例 ```cpp example #include @@ -58,3 +63,5 @@ hello - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) +- [LWG Issue 765. More on iterator validity](https://cplusplus.github.io/LWG/issue765) + - C++11で、`swap()`が参照・ポインタ・イテレータを無効化しないという要件に対して、「`end()`が返すイテレータはどの要素も指していないため、無効化されることがある」という注記が追加された From 3da38504b01cc6462b8b7f5a1a40f8225e90494d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 14:29:36 +0900 Subject: [PATCH 141/147] =?UTF-8?q?char=5Ftraits,=20to=5Fstring,=20to=5Fws?= =?UTF-8?q?tring:=20LWG=20Issue=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/string/char_traits.md | 2 ++ reference/string/to_string.md | 4 +++- reference/string/to_wstring.md | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/reference/string/char_traits.md b/reference/string/char_traits.md index 46082d1376..7c04289592 100644 --- a/reference/string/char_traits.md +++ b/reference/string/char_traits.md @@ -253,5 +253,7 @@ equal ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [LWG Issue 1414. Fixing remaining dead links to `POS_T` and `OFF_T`](https://cplusplus.github.io/LWG/issue1414) + - C++11で、`u16streampos`/`u32streampos`が満たすべき要件の参照先が、存在しない`POS_T`から`pos_type`の規定へ修正された - [LWG Issue 3518. Exception requirements on char trait operations unclear](https://cplusplus.github.io/LWG/issue3518) - C++23で、例外を送出してはならない対象が、character traits要件で規定された式に限定されることが明確化された diff --git a/reference/string/to_string.md b/reference/string/to_string.md index 2447be9fdf..883e2a7380 100644 --- a/reference/string/to_string.md +++ b/reference/string/to_string.md @@ -204,4 +204,6 @@ std::string to_string(long double val) - [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 + - C++26から整数バージョンが`constexpr`に対応した +- [LWG Issue 1261. Insufficent overloads for `to_string` / `to_wstring`](https://cplusplus.github.io/LWG/issue1261) + - C++11で、`int`/`unsigned`/`long`/`unsigned long`/`float`/`double`を受け取るオーバーロードが追加された。より大きな型のオーバーロードしかないと、変換が曖昧になったり意図しない拡張が起きたりするため diff --git a/reference/string/to_wstring.md b/reference/string/to_wstring.md index 3a747fe3d2..ac0d824aac 100644 --- a/reference/string/to_wstring.md +++ b/reference/string/to_wstring.md @@ -213,4 +213,6 @@ std::wstring to_wstring(long double val) - [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 + - C++26から整数バージョンが`constexpr`に対応した +- [LWG Issue 1261. Insufficent overloads for `to_string` / `to_wstring`](https://cplusplus.github.io/LWG/issue1261) + - C++11で、`int`/`unsigned`/`long`/`unsigned long`/`float`/`double`を受け取るオーバーロードが追加された。より大きな型のオーバーロードしかないと、変換が曖昧になったり意図しない拡張が起きたりするため From 3d277331e8e522eb4266e580d83607eb0a7827ce Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 14:30:37 +0900 Subject: [PATCH 142/147] =?UTF-8?q?map,=20set=20:=20LWG=20Issue=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/at.md | 2 ++ reference/map/map/op_assign.md | 2 ++ reference/map/map/op_constructor.md | 2 ++ reference/map/multimap/op_constructor.md | 2 ++ reference/set/multiset.md | 5 +++++ reference/set/multiset/op_constructor.md | 2 ++ reference/set/set.md | 5 +++++ reference/set/set/op_assign.md | 2 ++ reference/set/set/op_constructor.md | 2 ++ 9 files changed, 24 insertions(+) diff --git a/reference/map/map/at.md b/reference/map/map/at.md index c1e5b3f60a..1635a0eff1 100644 --- a/reference/map/map/at.md +++ b/reference/map/map/at.md @@ -111,3 +111,5 @@ exception std::out_of_range - [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) +- [LWG Issue 2007. Incorrect specification of return value for `map<>::at()`](https://cplusplus.github.io/LWG/issue2007) + - C++11で、戻り値の記述が「キーが等価な要素への参照」から「`x`に対応する`mapped_type`への参照」へ修正された。この関数が返すのは要素 (キーと値の`pair`) ではなく値であるため diff --git a/reference/map/map/op_assign.md b/reference/map/map/op_assign.md index c1597f53ac..5ef88a50f9 100644 --- a/reference/map/map/op_assign.md +++ b/reference/map/map/op_assign.md @@ -100,3 +100,5 @@ Size of m2: 5 - [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) +- [LWG Issue 982. Wrong complexity for `initializer_list` assignment in Table 85](https://cplusplus.github.io/LWG/issue982) + - C++11で、[`initializer_list`](/reference/initializer_list/initializer_list.md)からの代入の計算量が、誤って「定数時間」とされていたのを`a = X(il)`と同じ計算量へ修正された diff --git a/reference/map/map/op_constructor.md b/reference/map/map/op_constructor.md index c833287574..1bffd117ce 100644 --- a/reference/map/map/op_constructor.md +++ b/reference/map/map/op_constructor.md @@ -218,5 +218,7 @@ Size of m2: 2 - C++23でのアロケータ引数を`type_identity_t`で包む変更 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) - C++26で`map`のメンバが`constexpr`対応した +- [LWG Issue 1423. `map` constructor accepting an allocator as single parameter should be explicit](https://cplusplus.github.io/LWG/issue1423) + - C++11で、アロケータのみを受け取るコンストラクタに`explicit`が付加された。アロケータからコンテナへの意図しない暗黙変換を防ぐため - [LWG Issue 4291. `explicit map(const Allocator&)` should be constexpr](https://cplusplus.github.io/LWG/issue4291) - C++26で、他のコンストラクタと同様に(3) `explicit map(const Allocator&)`にも`constexpr`が追加された(P3372で付け忘れられていたものの修正) diff --git a/reference/map/multimap/op_constructor.md b/reference/map/multimap/op_constructor.md index 582f70c85b..9d4c1a6995 100644 --- a/reference/map/multimap/op_constructor.md +++ b/reference/map/multimap/op_constructor.md @@ -227,3 +227,5 @@ Size of m2: 3 - [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) +- [LWG Issue 1424. multimap constructor accepting an allocator as a single parameter should be explicit](https://cplusplus.github.io/LWG/issue1424) + - C++11で、アロケータのみを受け取るコンストラクタに`explicit`が付加された。アロケータからコンテナへの意図しない暗黙変換を防ぐため diff --git a/reference/set/multiset.md b/reference/set/multiset.md index 527b219eef..5c06d4ca68 100644 --- a/reference/set/multiset.md +++ b/reference/set/multiset.md @@ -212,3 +212,8 @@ int main() 1 1 ``` + + +## 参照 +- [LWG Issue 1040. Clarify possible sameness of associative container's `iterator` and `const_iterator`](https://cplusplus.github.io/LWG/issue1040) + - C++11で、要素型がキー型と同じ連想コンテナでは`iterator`と`const_iterator`が同じ型であってもよく、そうでなくてもよい旨が注記として明記された diff --git a/reference/set/multiset/op_constructor.md b/reference/set/multiset/op_constructor.md index 1958f274f6..5743530df3 100644 --- a/reference/set/multiset/op_constructor.md +++ b/reference/set/multiset/op_constructor.md @@ -215,3 +215,5 @@ Size of c2: 7 - [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) +- [LWG Issue 1426. multi`set` constructor accepting an allocator as a single parameter should be explicit](https://cplusplus.github.io/LWG/issue1426) + - C++11で、アロケータのみを受け取るコンストラクタに`explicit`が付加された。アロケータからコンテナへの意図しない暗黙変換を防ぐため diff --git a/reference/set/set.md b/reference/set/set.md index 9f1b889549..c667e3321c 100644 --- a/reference/set/set.md +++ b/reference/set/set.md @@ -213,3 +213,8 @@ int main() ``` 1 ``` + + +## 参照 +- [LWG Issue 1040. Clarify possible sameness of associative container's `iterator` and `const_iterator`](https://cplusplus.github.io/LWG/issue1040) + - C++11で、要素型がキー型と同じ連想コンテナでは`iterator`と`const_iterator`が同じ型であってもよく、そうでなくてもよい旨が注記として明記された diff --git a/reference/set/set/op_assign.md b/reference/set/set/op_assign.md index 5e0437c80d..9488de5386 100644 --- a/reference/set/set/op_assign.md +++ b/reference/set/set/op_assign.md @@ -90,3 +90,5 @@ Size of c2: 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) +- [LWG Issue 982. Wrong complexity for `initializer_list` assignment in Table 85](https://cplusplus.github.io/LWG/issue982) + - C++11で、[`initializer_list`](/reference/initializer_list/initializer_list.md)からの代入の計算量が、誤って「定数時間」とされていたのを`a = X(il)`と同じ計算量へ修正された diff --git a/reference/set/set/op_constructor.md b/reference/set/set/op_constructor.md index a658882216..cbbced204b 100644 --- a/reference/set/set/op_constructor.md +++ b/reference/set/set/op_constructor.md @@ -211,3 +211,5 @@ Size of c2: 6 - [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) +- [LWG Issue 1425. `set` constructor accepting an allocator as a single parameter should be explicit](https://cplusplus.github.io/LWG/issue1425) + - C++11で、アロケータのみを受け取るコンストラクタに`explicit`が付加された。アロケータからコンテナへの意図しない暗黙変換を防ぐため From 3475458227fc7e0347935de76003c4bd359da70e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 14:31:38 +0900 Subject: [PATCH 143/147] =?UTF-8?q?map,=20set=E3=81=AEswap:=20=E7=B5=82?= =?UTF-8?q?=E7=AB=AF=E3=82=A4=E3=83=86=E3=83=AC=E3=83=BC=E3=82=BF=E3=81=8C?= =?UTF-8?q?=E7=84=A1=E5=8A=B9=E3=81=AB=E3=81=AA=E3=82=8B=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E6=80=A7=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/map/map/swap.md | 7 +++++++ reference/set/set/swap.md | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/reference/map/map/swap.md b/reference/map/map/swap.md index 7ce792ed5e..c823a0f06c 100644 --- a/reference/map/map/swap.md +++ b/reference/map/map/swap.md @@ -30,6 +30,11 @@ constexpr void 定数時間 +## 備考 +- swapされるコンテナの要素を指す参照、ポインタ、イテレータを無効化しない。 + - ただし、[`end()`](end.md)が指すイテレータはどの要素も指していないが、無効になることがある。 + + ## 例 ```cpp example #include @@ -87,3 +92,5 @@ 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) +- [LWG Issue 765. More on iterator validity](https://cplusplus.github.io/LWG/issue765) + - C++11で、`swap()`が参照・ポインタ・イテレータを無効化しないという要件に対して、「`end()`が返すイテレータはどの要素も指していないため、無効化されることがある」という注記が追加された diff --git a/reference/set/set/swap.md b/reference/set/set/swap.md index a8019d2401..3d8b558630 100644 --- a/reference/set/set/swap.md +++ b/reference/set/set/swap.md @@ -28,6 +28,11 @@ constexpr void swap(set& x) 定数時間 +## 備考 +- swapされるコンテナの要素を指す参照、ポインタ、イテレータを無効化しない。 + - ただし、[`end()`](end.md)が指すイテレータはどの要素も指していないが、無効になることがある。 + + ## 例 ```cpp example #include @@ -67,3 +72,5 @@ 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) +- [LWG Issue 765. More on iterator validity](https://cplusplus.github.io/LWG/issue765) + - C++11で、`swap()`が参照・ポインタ・イテレータを無効化しないという要件に対して、「`end()`が返すイテレータはどの要素も指していないため、無効化されることがある」という注記が追加された From 5ecd4a29936f6b611cf0ff455381c2f7a8e16324 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 14:32:16 +0900 Subject: [PATCH 144/147] =?UTF-8?q?map,=20set=E3=81=AEemplace=20:=20?= =?UTF-8?q?=E3=81=93=E3=81=AE=E9=96=A2=E6=95=B0=E5=86=85=E3=81=A7=E4=BE=8B?= =?UTF-8?q?=E5=A4=96=E9=80=81=E5=87=BA=E3=81=8C=E7=99=BA=E7=94=9F=E3=81=97?= =?UTF-8?q?=E3=81=9F=E5=A0=B4=E5=90=88=E3=80=81=E5=8A=B9=E6=9E=9C=E3=81=AA?= =?UTF-8?q?=E3=81=97=E3=81=AB=E3=81=AA=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/map/map/emplace.md | 3 +++ reference/map/multimap/emplace.md | 1 + reference/set/multiset/emplace.md | 1 + reference/set/set/emplace.md | 3 +++ 4 files changed, 8 insertions(+) diff --git a/reference/map/map/emplace.md b/reference/map/map/emplace.md index 4a4fcdbfca..2355d78339 100644 --- a/reference/map/map/emplace.md +++ b/reference/map/map/emplace.md @@ -28,6 +28,7 @@ constexpr pair emplace(Args&&... args); // (1) C++26 ## 備考 +- この関数が例外を送出した場合、コンテナは何の効果も持たない。 - この関数が呼ばれた後も、当該コンテナ内の要素を指す参照やイテレータは無効にはならない。 なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 - C++17 で導入された [`try_emplace`](try_emplace.md) と異なり、たとえ要素が挿入されなかった場合でも `value_type` 型のオブジェクトが構築される可能性があり、結果として引数 `args` が [`move`](/reference/utility/move.md) の対象となって変更されてしまっている可能性があるため、注意が必要である。 @@ -165,3 +166,5 @@ 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) +- [LWG Issue 1253. invalidation of iterators and `emplace` vs. `insert` inconsistence in assoc. containers](https://cplusplus.github.io/LWG/issue1253) + - C++11で、単一要素の挿入時に例外が送出された場合に効果を持たないという保証と、イテレータ・参照が無効化されないという保証が、`insert()`だけでなく`emplace()`にも及ぶことが明記された diff --git a/reference/map/multimap/emplace.md b/reference/map/multimap/emplace.md index 2d450975b7..adfa1d7953 100644 --- a/reference/map/multimap/emplace.md +++ b/reference/map/multimap/emplace.md @@ -26,6 +26,7 @@ constexpr iterator emplace(Args&&... args); // (1) C++26 ## 備考 +- この関数が例外を送出した場合、コンテナは何の効果も持たない。 この関数が呼ばれた後も、当該コンテナ内の要素を指す参照やイテレータは無効にはならない。 なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 diff --git a/reference/set/multiset/emplace.md b/reference/set/multiset/emplace.md index f88abca766..9ea137d6f5 100644 --- a/reference/set/multiset/emplace.md +++ b/reference/set/multiset/emplace.md @@ -32,6 +32,7 @@ constexpr pair ## 備考 +- この関数が例外を送出した場合、コンテナは何の効果も持たない。 この関数が呼ばれた後も、当該コンテナ内の要素を指す参照やイテレータは無効にはならない。 なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 diff --git a/reference/set/set/emplace.md b/reference/set/set/emplace.md index e576806284..60a5c44b4f 100644 --- a/reference/set/set/emplace.md +++ b/reference/set/set/emplace.md @@ -31,6 +31,7 @@ constexpr pair emplace(Args&&... args); // (1) C++26 ## 備考 +- この関数が例外を送出した場合、コンテナは何の効果も持たない。 この関数が呼ばれた後も、当該コンテナ内の要素を指す参照やイテレータは無効にはならない。 なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 @@ -85,3 +86,5 @@ 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) +- [LWG Issue 1253. invalidation of iterators and `emplace` vs. `insert` inconsistence in assoc. containers](https://cplusplus.github.io/LWG/issue1253) + - C++11で、単一要素の挿入時に例外が送出された場合に効果を持たないという保証と、イテレータ・参照が無効化されないという保証が、`insert()`だけでなく`emplace()`にも及ぶことが明記された From fe2f2590ffb9229b90def33e1e69639ad4b52584 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 14:33:33 +0900 Subject: [PATCH 145/147] =?UTF-8?q?unordered=E7=B3=BB=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=83=86=E3=83=8A=20:=20LWG=20Issue=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/unordered_map/unordered_map/bucket.md | 2 ++ reference/unordered_map/unordered_map/bucket_size.md | 2 ++ reference/unordered_map/unordered_map/cend-size_type.md | 2 ++ reference/unordered_map/unordered_map/end-size_type.md | 2 ++ reference/unordered_map/unordered_map/insert.md | 4 +++- reference/unordered_map/unordered_map/op_assign.md | 2 ++ reference/unordered_map/unordered_map/op_constructor.md | 6 ++++++ reference/unordered_map/unordered_map/reserve.md | 4 +++- reference/unordered_map/unordered_multimap/bucket.md | 2 ++ reference/unordered_map/unordered_multimap/bucket_size.md | 2 ++ .../unordered_map/unordered_multimap/cend-size_type.md | 2 ++ reference/unordered_map/unordered_multimap/end-size_type.md | 2 ++ reference/unordered_map/unordered_multimap/insert.md | 4 +++- .../unordered_map/unordered_multimap/op_constructor.md | 4 ++++ reference/unordered_map/unordered_multimap/reserve.md | 4 +++- reference/unordered_set/unordered_multiset/bucket.md | 2 ++ reference/unordered_set/unordered_multiset/bucket_size.md | 2 ++ .../unordered_set/unordered_multiset/cend-size_type.md | 2 ++ reference/unordered_set/unordered_multiset/end-size_type.md | 2 ++ reference/unordered_set/unordered_multiset/insert.md | 2 ++ .../unordered_set/unordered_multiset/op_constructor.md | 4 ++++ reference/unordered_set/unordered_multiset/reserve.md | 2 ++ reference/unordered_set/unordered_set/bucket.md | 2 ++ reference/unordered_set/unordered_set/cend-size_type.md | 2 ++ reference/unordered_set/unordered_set/end-size_type.md | 2 ++ reference/unordered_set/unordered_set/insert.md | 2 ++ reference/unordered_set/unordered_set/op_assign.md | 2 ++ reference/unordered_set/unordered_set/op_constructor.md | 6 ++++++ reference/unordered_set/unordered_set/reserve.md | 2 ++ 29 files changed, 74 insertions(+), 4 deletions(-) diff --git a/reference/unordered_map/unordered_map/bucket.md b/reference/unordered_map/unordered_map/bucket.md index f506e31560..83418b5041 100644 --- a/reference/unordered_map/unordered_map/bucket.md +++ b/reference/unordered_map/unordered_map/bucket.md @@ -116,3 +116,5 @@ 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) +- [LWG Issue 1197. Can unordered containers have `bucket_count()` == 0?](https://cplusplus.github.io/LWG/issue1197) + - C++11で、[`bucket_count()`](bucket_count.md)` > 0`という事前条件が追加された。バケット数が`0`の場合、剰余によるバケット決定が行えないため diff --git a/reference/unordered_map/unordered_map/bucket_size.md b/reference/unordered_map/unordered_map/bucket_size.md index 5ddcd8338f..487e91da63 100644 --- a/reference/unordered_map/unordered_map/bucket_size.md +++ b/reference/unordered_map/unordered_map/bucket_size.md @@ -104,3 +104,5 @@ bucket = 10, bucket_size = 1, keys = { A, } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 1519. `bucketsize()` const only for unordered set](https://cplusplus.github.io/LWG/issue1519) + - C++11で、この関数に`const`修飾が付加された。[`unordered_set`](/reference/unordered_set/unordered_set.md)の宣言には付いていたが、ほかの非順序連想コンテナでは記載が漏れていた diff --git a/reference/unordered_map/unordered_map/cend-size_type.md b/reference/unordered_map/unordered_map/cend-size_type.md index f602a9abad..73f5d8e9fd 100644 --- a/reference/unordered_map/unordered_map/cend-size_type.md +++ b/reference/unordered_map/unordered_map/cend-size_type.md @@ -103,3 +103,5 @@ bucket = 10, bucket_size = 1, keys = { A, } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 869. Bucket (local) iterators and iterating past end](https://cplusplus.github.io/LWG/issue869) + - C++11で、この関数がバケットの終端を指すイテレータを返すことが明記された。それ以前は終端を指すことが規定されておらず、バケットを走査してよいかが不明確だった diff --git a/reference/unordered_map/unordered_map/end-size_type.md b/reference/unordered_map/unordered_map/end-size_type.md index d9e236a6c0..e734233d1f 100644 --- a/reference/unordered_map/unordered_map/end-size_type.md +++ b/reference/unordered_map/unordered_map/end-size_type.md @@ -106,3 +106,5 @@ bucket = 10, bucket_size = 1, keys = { A, } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 869. Bucket (local) iterators and iterating past end](https://cplusplus.github.io/LWG/issue869) + - C++11で、この関数がバケットの終端を指すイテレータを返すことが明記された。それ以前は終端を指すことが規定されておらず、バケットを走査してよいかが不明確だった diff --git a/reference/unordered_map/unordered_map/insert.md b/reference/unordered_map/unordered_map/insert.md index 6a97725380..766c2cfbd0 100644 --- a/reference/unordered_map/unordered_map/insert.md +++ b/reference/unordered_map/unordered_map/insert.md @@ -324,10 +324,12 @@ inline void unordered_map::insert(initializer_list il); // (3) C++2 - [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) +- [LWG Issue 981. Unordered container requirements should add `initializer_list` support](https://cplusplus.github.io/LWG/issue981) + - C++11で、非順序連想コンテナの要件に[`initializer_list`](/reference/initializer_list/initializer_list.md)からの構築・代入・挿入が追加された。他のコンテナには追加されていたが、非順序連想コンテナでは漏れていたため diff --git a/reference/unordered_map/unordered_map/op_constructor.md b/reference/unordered_map/unordered_map/op_constructor.md index 81f1479b88..4bf97d5553 100644 --- a/reference/unordered_map/unordered_map/op_constructor.md +++ b/reference/unordered_map/unordered_map/op_constructor.md @@ -350,3 +350,9 @@ libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 - [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) +- [LWG Issue 676. Moving the unordered containers](https://cplusplus.github.io/LWG/issue676) + - C++11で、非順序連想コンテナにムーブコンストラクタ・ムーブ代入演算子と、`value_type`へ変換可能な型を転送で受け取る`insert`のオーバーロードが追加された。他のコンテナには追加されていたムーブ対応が漏れていたため +- [LWG Issue 981. Unordered container requirements should add `initializer_list` support](https://cplusplus.github.io/LWG/issue981) + - C++11で、非順序連想コンテナの要件に[`initializer_list`](/reference/initializer_list/initializer_list.md)からの構築・代入・挿入が追加された。他のコンテナには追加されていたが、非順序連想コンテナでは漏れていたため +- [LWG Issue 1427. `unordered_map` constructor accepting an allocator as a single parameter should be explicit](https://cplusplus.github.io/LWG/issue1427) + - C++11で、アロケータのみを受け取るコンストラクタに`explicit`が付加された。アロケータからコンテナへの意図しない暗黙変換を防ぐため diff --git a/reference/unordered_map/unordered_map/reserve.md b/reference/unordered_map/unordered_map/reserve.md index f212161894..c4410786e2 100644 --- a/reference/unordered_map/unordered_map/reserve.md +++ b/reference/unordered_map/unordered_map/reserve.md @@ -130,5 +130,7 @@ new load_factor: 0.363636 | [`emplace_hint`](emplace_hint.md) | 挿入位置のヒントを使用したコンテナ内への要素の直接構築 | ## 参照 -- [LWG Issue 2156. Unordered containers' reserve(n) reserves for n-1 elements](https://wg21.cmeerw.net/lwg/issue2156) +- [LWG Issue 1189. Awkward interface for changing the number of buckets in an unordered associative container](https://cplusplus.github.io/LWG/issue1189) + - C++11で、要素数を指定してバケット数を確保する`reserve()`が追加された。`rehash()`はバケット数を指定するため、要素数から計算する必要があった - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 2156. Unordered containers' reserve(n) reserves for n-1 elements](https://wg21.cmeerw.net/lwg/issue2156) diff --git a/reference/unordered_map/unordered_multimap/bucket.md b/reference/unordered_map/unordered_multimap/bucket.md index da6b875c1e..c1033baff1 100644 --- a/reference/unordered_map/unordered_multimap/bucket.md +++ b/reference/unordered_map/unordered_multimap/bucket.md @@ -114,3 +114,5 @@ 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) +- [LWG Issue 1197. Can unordered containers have `bucket_count()` == 0?](https://cplusplus.github.io/LWG/issue1197) + - C++11で、[`bucket_count()`](bucket_count.md)` > 0`という事前条件が追加された。バケット数が`0`の場合、剰余によるバケット決定が行えないため diff --git a/reference/unordered_map/unordered_multimap/bucket_size.md b/reference/unordered_map/unordered_multimap/bucket_size.md index 5806dcc3f3..079c5d8b41 100644 --- a/reference/unordered_map/unordered_multimap/bucket_size.md +++ b/reference/unordered_map/unordered_multimap/bucket_size.md @@ -104,3 +104,5 @@ bucket = 10, bucket_size = 1, keys = { A, } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 1519. `bucketsize()` const only for unordered set](https://cplusplus.github.io/LWG/issue1519) + - C++11で、この関数に`const`修飾が付加された。[`unordered_set`](/reference/unordered_set/unordered_set.md)の宣言には付いていたが、ほかの非順序連想コンテナでは記載が漏れていた diff --git a/reference/unordered_map/unordered_multimap/cend-size_type.md b/reference/unordered_map/unordered_multimap/cend-size_type.md index df73a601aa..9965553372 100644 --- a/reference/unordered_map/unordered_multimap/cend-size_type.md +++ b/reference/unordered_map/unordered_multimap/cend-size_type.md @@ -103,3 +103,5 @@ bucket = 10, bucket_size = 1, keys = { A, } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 869. Bucket (local) iterators and iterating past end](https://cplusplus.github.io/LWG/issue869) + - C++11で、この関数がバケットの終端を指すイテレータを返すことが明記された。それ以前は終端を指すことが規定されておらず、バケットを走査してよいかが不明確だった diff --git a/reference/unordered_map/unordered_multimap/end-size_type.md b/reference/unordered_map/unordered_multimap/end-size_type.md index 1bbb0ad154..b67af30d5b 100644 --- a/reference/unordered_map/unordered_multimap/end-size_type.md +++ b/reference/unordered_map/unordered_multimap/end-size_type.md @@ -106,3 +106,5 @@ bucket = 10, bucket_size = 1, keys = { A, } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 869. Bucket (local) iterators and iterating past end](https://cplusplus.github.io/LWG/issue869) + - C++11で、この関数がバケットの終端を指すイテレータを返すことが明記された。それ以前は終端を指すことが規定されておらず、バケットを走査してよいかが不明確だった diff --git a/reference/unordered_map/unordered_multimap/insert.md b/reference/unordered_map/unordered_multimap/insert.md index b78468dd03..7bbe8983c8 100644 --- a/reference/unordered_map/unordered_multimap/insert.md +++ b/reference/unordered_map/unordered_multimap/insert.md @@ -316,10 +316,12 @@ inline void unordered_multimap::insert(initializer_l - (8)の経緯となる提案文書 - [LWG Issue 518. Are `insert` and `erase` stable for `unordered_multiset` and `unordered_multimap`?](https://wg21.cmeerw.net/lwg/issue518) - 安定性の保証が規定された経緯のレポート +- [LWG Issue 676. Moving the unordered containers](https://cplusplus.github.io/LWG/issue676) + - C++11で、非順序連想コンテナにムーブコンストラクタ・ムーブ代入演算子と、`value_type`へ変換可能な型を転送で受け取る`insert`のオーバーロードが追加された。他のコンテナには追加されていたムーブ対応が漏れていたため - [LWG Issue 2005. `unordered_map::insert(T&&)` protection should apply to `map` too](https://wg21.cmeerw.net/lwg/issue2005) -- [LWG Issue 2540. unordered_multimap::insert hint iterator](https://wg21.cmeerw.net/lwg/issue2540) - [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) - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 2540. unordered_multimap::insert hint iterator](https://wg21.cmeerw.net/lwg/issue2540) diff --git a/reference/unordered_map/unordered_multimap/op_constructor.md b/reference/unordered_map/unordered_multimap/op_constructor.md index 92d8fcce7d..d9412daf61 100644 --- a/reference/unordered_map/unordered_multimap/op_constructor.md +++ b/reference/unordered_map/unordered_multimap/op_constructor.md @@ -355,3 +355,7 @@ libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 - [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) +- [LWG Issue 676. Moving the unordered containers](https://cplusplus.github.io/LWG/issue676) + - C++11で、非順序連想コンテナにムーブコンストラクタ・ムーブ代入演算子と、`value_type`へ変換可能な型を転送で受け取る`insert`のオーバーロードが追加された。他のコンテナには追加されていたムーブ対応が漏れていたため +- [LWG Issue 1428. `unordered_multimap` constructor accepting an allocator as a single parameter should be explicit](https://cplusplus.github.io/LWG/issue1428) + - C++11で、アロケータのみを受け取るコンストラクタに`explicit`が付加された。アロケータからコンテナへの意図しない暗黙変換を防ぐため diff --git a/reference/unordered_map/unordered_multimap/reserve.md b/reference/unordered_map/unordered_multimap/reserve.md index 8a904456a6..ceb7bf4638 100644 --- a/reference/unordered_map/unordered_multimap/reserve.md +++ b/reference/unordered_map/unordered_multimap/reserve.md @@ -130,5 +130,7 @@ new load_factor: 0.363636 | [`emplace_hint`](emplace_hint.md) | 挿入位置のヒントを使用したコンテナ内への要素の直接構築 | ## 参照 -- [LWG Issue 2156. Unordered containers' reserve(n) reserves for n-1 elements](https://wg21.cmeerw.net/lwg/issue2156) +- [LWG Issue 1189. Awkward interface for changing the number of buckets in an unordered associative container](https://cplusplus.github.io/LWG/issue1189) + - C++11で、要素数を指定してバケット数を確保する`reserve()`が追加された。`rehash()`はバケット数を指定するため、要素数から計算する必要があった - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 2156. Unordered containers' reserve(n) reserves for n-1 elements](https://wg21.cmeerw.net/lwg/issue2156) diff --git a/reference/unordered_set/unordered_multiset/bucket.md b/reference/unordered_set/unordered_multiset/bucket.md index a3ff8fd668..dc0bd4cd7e 100644 --- a/reference/unordered_set/unordered_multiset/bucket.md +++ b/reference/unordered_set/unordered_multiset/bucket.md @@ -114,3 +114,5 @@ 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) +- [LWG Issue 1197. Can unordered containers have `bucket_count()` == 0?](https://cplusplus.github.io/LWG/issue1197) + - C++11で、[`bucket_count()`](bucket_count.md)` > 0`という事前条件が追加された。バケット数が`0`の場合、剰余によるバケット決定が行えないため diff --git a/reference/unordered_set/unordered_multiset/bucket_size.md b/reference/unordered_set/unordered_multiset/bucket_size.md index 69b5b31524..cdec29def5 100644 --- a/reference/unordered_set/unordered_multiset/bucket_size.md +++ b/reference/unordered_set/unordered_multiset/bucket_size.md @@ -95,3 +95,5 @@ bucket = 10, bucket_size = 0, keys = { } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 1519. `bucketsize()` const only for unordered set](https://cplusplus.github.io/LWG/issue1519) + - C++11で、この関数に`const`修飾が付加された。[`unordered_set`](/reference/unordered_set/unordered_set.md)の宣言には付いていたが、ほかの非順序連想コンテナでは記載が漏れていた diff --git a/reference/unordered_set/unordered_multiset/cend-size_type.md b/reference/unordered_set/unordered_multiset/cend-size_type.md index 8f923ad128..cba4fa9d8a 100644 --- a/reference/unordered_set/unordered_multiset/cend-size_type.md +++ b/reference/unordered_set/unordered_multiset/cend-size_type.md @@ -97,3 +97,5 @@ bucket = 10, bucket_size = 0, keys = { } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 869. Bucket (local) iterators and iterating past end](https://cplusplus.github.io/LWG/issue869) + - C++11で、この関数がバケットの終端を指すイテレータを返すことが明記された。それ以前は終端を指すことが規定されておらず、バケットを走査してよいかが不明確だった diff --git a/reference/unordered_set/unordered_multiset/end-size_type.md b/reference/unordered_set/unordered_multiset/end-size_type.md index 41f5a3b7ea..a61ea154f3 100644 --- a/reference/unordered_set/unordered_multiset/end-size_type.md +++ b/reference/unordered_set/unordered_multiset/end-size_type.md @@ -106,3 +106,5 @@ bucket = 10, bucket_size = 0, keys = { } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 869. Bucket (local) iterators and iterating past end](https://cplusplus.github.io/LWG/issue869) + - C++11で、この関数がバケットの終端を指すイテレータを返すことが明記された。それ以前は終端を指すことが規定されておらず、バケットを走査してよいかが不明確だった diff --git a/reference/unordered_set/unordered_multiset/insert.md b/reference/unordered_set/unordered_multiset/insert.md index 39590d9a50..9392905b90 100644 --- a/reference/unordered_set/unordered_multiset/insert.md +++ b/reference/unordered_set/unordered_multiset/insert.md @@ -257,3 +257,5 @@ inline void unordered_multiset::insert(std::initiali - (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) +- [LWG Issue 676. Moving the unordered containers](https://cplusplus.github.io/LWG/issue676) + - C++11で、`value_type&&`を受け取るオーバーロードが追加された。他のコンテナには追加されていたムーブ対応が漏れていたため diff --git a/reference/unordered_set/unordered_multiset/op_constructor.md b/reference/unordered_set/unordered_multiset/op_constructor.md index 3bd98d667b..4200bc1d59 100644 --- a/reference/unordered_set/unordered_multiset/op_constructor.md +++ b/reference/unordered_set/unordered_multiset/op_constructor.md @@ -362,3 +362,7 @@ libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 - [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) +- [LWG Issue 676. Moving the unordered containers](https://cplusplus.github.io/LWG/issue676) + - C++11で、非順序連想コンテナにムーブコンストラクタとムーブ代入演算子が追加された。他のコンテナには追加されていたムーブ対応が漏れていたため +- [LWG Issue 1430. `unordered_multiset` constructor accepting an allocator as a single parameter should be explicit](https://cplusplus.github.io/LWG/issue1430) + - C++11で、アロケータのみを受け取るコンストラクタに`explicit`が付加された。アロケータからコンテナへの意図しない暗黙変換を防ぐため diff --git a/reference/unordered_set/unordered_multiset/reserve.md b/reference/unordered_set/unordered_multiset/reserve.md index 4b2db37b59..95fc29ca39 100644 --- a/reference/unordered_set/unordered_multiset/reserve.md +++ b/reference/unordered_set/unordered_multiset/reserve.md @@ -109,3 +109,5 @@ bucket_count is 13 ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 1189. Awkward interface for changing the number of buckets in an unordered associative container](https://cplusplus.github.io/LWG/issue1189) + - C++11で、要素数を指定してバケット数を確保する`reserve()`が追加された。`rehash()`はバケット数を指定するため、要素数から計算する必要があった diff --git a/reference/unordered_set/unordered_set/bucket.md b/reference/unordered_set/unordered_set/bucket.md index 0b2ed13dd4..b07dbec091 100644 --- a/reference/unordered_set/unordered_set/bucket.md +++ b/reference/unordered_set/unordered_set/bucket.md @@ -109,3 +109,5 @@ 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) +- [LWG Issue 1197. Can unordered containers have `bucket_count()` == 0?](https://cplusplus.github.io/LWG/issue1197) + - C++11で、[`bucket_count()`](bucket_count.md)` > 0`という事前条件が追加された。バケット数が`0`の場合、剰余によるバケット決定が行えないため diff --git a/reference/unordered_set/unordered_set/cend-size_type.md b/reference/unordered_set/unordered_set/cend-size_type.md index 80ff967c1e..971917ba24 100644 --- a/reference/unordered_set/unordered_set/cend-size_type.md +++ b/reference/unordered_set/unordered_set/cend-size_type.md @@ -91,3 +91,5 @@ bucket = 4, bucket_size = 2, keys = { C, B, } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 869. Bucket (local) iterators and iterating past end](https://cplusplus.github.io/LWG/issue869) + - C++11で、この関数がバケットの終端を指すイテレータを返すことが明記された。それ以前は終端を指すことが規定されておらず、バケットを走査してよいかが不明確だった diff --git a/reference/unordered_set/unordered_set/end-size_type.md b/reference/unordered_set/unordered_set/end-size_type.md index 69b16eb695..8c532c43cd 100644 --- a/reference/unordered_set/unordered_set/end-size_type.md +++ b/reference/unordered_set/unordered_set/end-size_type.md @@ -100,3 +100,5 @@ bucket = 4, bucket_size = 2, keys = { C, B, } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 869. Bucket (local) iterators and iterating past end](https://cplusplus.github.io/LWG/issue869) + - C++11で、この関数がバケットの終端を指すイテレータを返すことが明記された。それ以前は終端を指すことが規定されておらず、バケットを走査してよいかが不明確だった diff --git a/reference/unordered_set/unordered_set/insert.md b/reference/unordered_set/unordered_set/insert.md index 7e6f5ed46e..5bbe00b163 100644 --- a/reference/unordered_set/unordered_set/insert.md +++ b/reference/unordered_set/unordered_set/insert.md @@ -319,3 +319,5 @@ inline void unordered_set::insert(initializer_list`のバージョンが追加された - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 676. Moving the unordered containers](https://cplusplus.github.io/LWG/issue676) + - C++11で、`value_type&&`を受け取るオーバーロードが追加された。他のコンテナには追加されていたムーブ対応が漏れていたため diff --git a/reference/unordered_set/unordered_set/op_assign.md b/reference/unordered_set/unordered_set/op_assign.md index a75d492d3c..f793aa28f6 100644 --- a/reference/unordered_set/unordered_set/op_assign.md +++ b/reference/unordered_set/unordered_set/op_assign.md @@ -99,3 +99,5 @@ constexpr unordered_set& operator=(initializer_list il); // (3) C++2 - [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) +- [LWG Issue 981. Unordered container requirements should add `initializer_list` support](https://cplusplus.github.io/LWG/issue981) + - C++11で、非順序連想コンテナの要件に[`initializer_list`](/reference/initializer_list/initializer_list.md)からの構築・代入・挿入が追加された。他のコンテナには追加されていたが、非順序連想コンテナでは漏れていたため diff --git a/reference/unordered_set/unordered_set/op_constructor.md b/reference/unordered_set/unordered_set/op_constructor.md index 56d75570d8..5006f35a5f 100644 --- a/reference/unordered_set/unordered_set/op_constructor.md +++ b/reference/unordered_set/unordered_set/op_constructor.md @@ -360,3 +360,9 @@ libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 - [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) +- [LWG Issue 676. Moving the unordered containers](https://cplusplus.github.io/LWG/issue676) + - C++11で、非順序連想コンテナにムーブコンストラクタとムーブ代入演算子が追加された。他のコンテナには追加されていたムーブ対応が漏れていたため +- [LWG Issue 981. Unordered container requirements should add `initializer_list` support](https://cplusplus.github.io/LWG/issue981) + - C++11で、非順序連想コンテナの要件に[`initializer_list`](/reference/initializer_list/initializer_list.md)からの構築・代入・挿入が追加された。他のコンテナには追加されていたが、非順序連想コンテナでは漏れていたため +- [LWG Issue 1429. `unordered_set` constructor accepting an allocator as a single parameter should be explicit](https://cplusplus.github.io/LWG/issue1429) + - C++11で、アロケータのみを受け取るコンストラクタに`explicit`が付加された。アロケータからコンテナへの意図しない暗黙変換を防ぐため diff --git a/reference/unordered_set/unordered_set/reserve.md b/reference/unordered_set/unordered_set/reserve.md index d8e532128e..28f49e80fe 100644 --- a/reference/unordered_set/unordered_set/reserve.md +++ b/reference/unordered_set/unordered_set/reserve.md @@ -109,3 +109,5 @@ bucket_count is 7 ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 1189. Awkward interface for changing the number of buckets in an unordered associative container](https://cplusplus.github.io/LWG/issue1189) + - C++11で、要素数を指定してバケット数を確保する`reserve()`が追加された。`rehash()`はバケット数を指定するため、要素数から計算する必要があった From 51c2484d88c24adc94aea1656a642995d68b7484 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 14:34:34 +0900 Subject: [PATCH 146/147] =?UTF-8?q?unordered=E7=B3=BB=E3=81=AE=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=87=E3=83=83=E3=82=AF=E3=82=B9=E3=82=92=E3=81=A8?= =?UTF-8?q?=E3=82=8Bbegin/end=20:=20=E3=83=91=E3=82=B1=E3=83=83=E3=83=88?= =?UTF-8?q?=E3=81=8C=E3=81=8B=E3=82=89=E3=81=A7=E3=81=82=E3=82=8B=E5=A0=B4?= =?UTF-8?q?=E5=90=88=E3=81=AB=E7=B5=82=E7=AB=AF=E3=82=A4=E3=83=86=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E3=81=8C=E8=BF=94=E3=81=95=E3=82=8C=E3=82=8B?= =?UTF-8?q?=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/unordered_map/unordered_map/begin-size_type.md | 5 +++++ reference/unordered_map/unordered_map/cbegin-size_type.md | 5 +++++ .../unordered_map/unordered_multimap/begin-size_type.md | 5 +++++ .../unordered_map/unordered_multimap/cbegin-size_type.md | 5 +++++ .../unordered_set/unordered_multiset/begin-size_type.md | 5 +++++ .../unordered_set/unordered_multiset/cbegin-size_type.md | 5 +++++ reference/unordered_set/unordered_set/begin-size_type.md | 5 +++++ reference/unordered_set/unordered_set/cbegin-size_type.md | 5 +++++ 8 files changed, 40 insertions(+) diff --git a/reference/unordered_map/unordered_map/begin-size_type.md b/reference/unordered_map/unordered_map/begin-size_type.md index 056e5f46f3..4b95c722d3 100644 --- a/reference/unordered_map/unordered_map/begin-size_type.md +++ b/reference/unordered_map/unordered_map/begin-size_type.md @@ -27,6 +27,9 @@ constexpr const_local_iterator begin(size_type n) const; // (2) C++26 インデックス(添え字) `n` で指定したバケット内の先頭の要素を指すイテレータ +バケットが空である場合、[`end(size_type)`](end-size_type.md)が返すイテレータと等値になる。 + + ## 計算量 定数 @@ -106,3 +109,5 @@ bucket = 10, bucket_size = 1, keys = { A, } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 869. Bucket (local) iterators and iterating past end](https://cplusplus.github.io/LWG/issue869) + - C++11で、要件表の記述が「`[b.begin(n), b.end(n))`が有効な範囲である」という注記から、「バケットの最初の要素を指すイテレータを返す。バケットが空なら`b.begin(n) == b.end(n)`となる」という直接の記述へ改められた diff --git a/reference/unordered_map/unordered_map/cbegin-size_type.md b/reference/unordered_map/unordered_map/cbegin-size_type.md index bbc5308c77..84ae1c877f 100644 --- a/reference/unordered_map/unordered_map/cbegin-size_type.md +++ b/reference/unordered_map/unordered_map/cbegin-size_type.md @@ -24,6 +24,9 @@ constexpr const_local_iterator cbegin(size_type n) const; // (1) C++26 インデックス(添え字) `n` で指定したバケット内の先頭の要素を指すイテレータ +バケットが空である場合、[`cend(size_type)`](cend-size_type.md)が返すイテレータと等値になる。 + + ## 計算量 定数 @@ -103,3 +106,5 @@ bucket = 10, bucket_size = 1, keys = { A, } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 869. Bucket (local) iterators and iterating past end](https://cplusplus.github.io/LWG/issue869) + - C++11で、要件表の記述が「`[b.begin(n), b.end(n))`が有効な範囲である」という注記から、「バケットの最初の要素を指すイテレータを返す。バケットが空なら`b.begin(n) == b.end(n)`となる」という直接の記述へ改められた diff --git a/reference/unordered_map/unordered_multimap/begin-size_type.md b/reference/unordered_map/unordered_multimap/begin-size_type.md index cae678b002..f050f6be81 100644 --- a/reference/unordered_map/unordered_multimap/begin-size_type.md +++ b/reference/unordered_map/unordered_multimap/begin-size_type.md @@ -27,6 +27,9 @@ constexpr const_local_iterator begin(size_type n) const; // (2) C++26 インデックス(添え字) `n` で指定したバケット内の先頭の要素を指すイテレータ +バケットが空である場合、[`end(size_type)`](end-size_type.md)が返すイテレータと等値になる。 + + ## 計算量 定数 @@ -106,3 +109,5 @@ bucket = 10, bucket_size = 1, keys = { A, } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 869. Bucket (local) iterators and iterating past end](https://cplusplus.github.io/LWG/issue869) + - C++11で、要件表の記述が「`[b.begin(n), b.end(n))`が有効な範囲である」という注記から、「バケットの最初の要素を指すイテレータを返す。バケットが空なら`b.begin(n) == b.end(n)`となる」という直接の記述へ改められた diff --git a/reference/unordered_map/unordered_multimap/cbegin-size_type.md b/reference/unordered_map/unordered_multimap/cbegin-size_type.md index 586585f0b2..f1627ee84f 100644 --- a/reference/unordered_map/unordered_multimap/cbegin-size_type.md +++ b/reference/unordered_map/unordered_multimap/cbegin-size_type.md @@ -24,6 +24,9 @@ constexpr const_local_iterator cbegin(size_type n) const; // (1) C++26 インデックス(添え字) `n` で指定したバケット内の先頭の要素を指すイテレータ +バケットが空である場合、[`cend(size_type)`](cend-size_type.md)が返すイテレータと等値になる。 + + ## 計算量 定数 @@ -103,3 +106,5 @@ bucket = 10, bucket_size = 1, keys = { A, } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 869. Bucket (local) iterators and iterating past end](https://cplusplus.github.io/LWG/issue869) + - C++11で、要件表の記述が「`[b.begin(n), b.end(n))`が有効な範囲である」という注記から、「バケットの最初の要素を指すイテレータを返す。バケットが空なら`b.begin(n) == b.end(n)`となる」という直接の記述へ改められた diff --git a/reference/unordered_set/unordered_multiset/begin-size_type.md b/reference/unordered_set/unordered_multiset/begin-size_type.md index bd18a81bb8..3a1d04aed6 100644 --- a/reference/unordered_set/unordered_multiset/begin-size_type.md +++ b/reference/unordered_set/unordered_multiset/begin-size_type.md @@ -27,6 +27,9 @@ constexpr const_local_iterator begin(size_type n) const; // (2) C++26 インデックス(添え字) `n` で指定したバケット内の先頭の要素を指すイテレータ +バケットが空である場合、[`end(size_type)`](end-size_type.md)が返すイテレータと等値になる。 + + ## 計算量 定数 @@ -106,3 +109,5 @@ bucket = 10, bucket_size = 0, keys = { } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 869. Bucket (local) iterators and iterating past end](https://cplusplus.github.io/LWG/issue869) + - C++11で、要件表の記述が「`[b.begin(n), b.end(n))`が有効な範囲である」という注記から、「バケットの最初の要素を指すイテレータを返す。バケットが空なら`b.begin(n) == b.end(n)`となる」という直接の記述へ改められた diff --git a/reference/unordered_set/unordered_multiset/cbegin-size_type.md b/reference/unordered_set/unordered_multiset/cbegin-size_type.md index 0f3cd70f5a..ed12656ab6 100644 --- a/reference/unordered_set/unordered_multiset/cbegin-size_type.md +++ b/reference/unordered_set/unordered_multiset/cbegin-size_type.md @@ -24,6 +24,9 @@ constexpr const_local_iterator cbegin(size_type n) const; // (1) C++26 インデックス(添え字) `n` で指定したバケット内の先頭の要素を指すイテレータ +バケットが空である場合、[`cend(size_type)`](cend-size_type.md)が返すイテレータと等値になる。 + + ## 計算量 定数 @@ -97,3 +100,5 @@ bucket = 10, bucket_size = 0, keys = { } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 869. Bucket (local) iterators and iterating past end](https://cplusplus.github.io/LWG/issue869) + - C++11で、要件表の記述が「`[b.begin(n), b.end(n))`が有効な範囲である」という注記から、「バケットの最初の要素を指すイテレータを返す。バケットが空なら`b.begin(n) == b.end(n)`となる」という直接の記述へ改められた diff --git a/reference/unordered_set/unordered_set/begin-size_type.md b/reference/unordered_set/unordered_set/begin-size_type.md index 2e22ca58f6..315fef59dd 100644 --- a/reference/unordered_set/unordered_set/begin-size_type.md +++ b/reference/unordered_set/unordered_set/begin-size_type.md @@ -27,6 +27,9 @@ constexpr const_local_iterator begin(size_type n) const; // (2) C++26 インデックス(添え字) `n` で指定したバケット内の先頭の要素を指すイテレータ +バケットが空である場合、[`end(size_type)`](end-size_type.md)が返すイテレータと等値になる。 + + ## 計算量 定数 @@ -100,3 +103,5 @@ bucket = 4, bucket_size = 2, keys = { C, B, } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 869. Bucket (local) iterators and iterating past end](https://cplusplus.github.io/LWG/issue869) + - C++11で、要件表の記述が「`[b.begin(n), b.end(n))`が有効な範囲である」という注記から、「バケットの最初の要素を指すイテレータを返す。バケットが空なら`b.begin(n) == b.end(n)`となる」という直接の記述へ改められた diff --git a/reference/unordered_set/unordered_set/cbegin-size_type.md b/reference/unordered_set/unordered_set/cbegin-size_type.md index fd4119b10c..fc7aa57fc6 100644 --- a/reference/unordered_set/unordered_set/cbegin-size_type.md +++ b/reference/unordered_set/unordered_set/cbegin-size_type.md @@ -24,6 +24,9 @@ constexpr const_local_iterator cbegin(size_type n) const; // (1) C++26 インデックス(添え字) `n` で指定したバケット内の先頭の要素を指すイテレータ +バケットが空である場合、[`cend(size_type)`](cend-size_type.md)が返すイテレータと等値になる。 + + ## 計算量 定数 @@ -91,3 +94,5 @@ bucket = 4, bucket_size = 2, keys = { C, B, } ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 869. Bucket (local) iterators and iterating past end](https://cplusplus.github.io/LWG/issue869) + - C++11で、要件表の記述が「`[b.begin(n), b.end(n))`が有効な範囲である」という注記から、「バケットの最初の要素を指すイテレータを返す。バケットが空なら`b.begin(n) == b.end(n)`となる」という直接の記述へ改められた From bde6ec950ee49ac47899d6f7b11dee0bfe28c26a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Aug 2026 14:35:00 +0900 Subject: [PATCH 147/147] =?UTF-8?q?unordered=E7=B3=BB=E3=81=AEemplace=20:?= =?UTF-8?q?=20=E3=81=93=E3=81=AE=E9=96=A2=E6=95=B0=E5=86=85=E3=81=A7?= =?UTF-8?q?=E4=BE=8B=E5=A4=96=E9=80=81=E5=87=BA=E3=81=8C=E8=B5=B7=E3=81=93?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E5=A0=B4=E5=90=88=E3=81=AB=E5=8A=B9=E6=9E=9C?= =?UTF-8?q?=E3=81=AA=E3=81=97=E3=81=AB=E3=81=AA=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/unordered_map/unordered_map/emplace.md | 5 ++++- reference/unordered_map/unordered_multimap/emplace.md | 1 + reference/unordered_set/unordered_multiset/emplace.md | 1 + reference/unordered_set/unordered_set/emplace.md | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/reference/unordered_map/unordered_map/emplace.md b/reference/unordered_map/unordered_map/emplace.md index 7192d34a63..d2b350cd35 100644 --- a/reference/unordered_map/unordered_map/emplace.md +++ b/reference/unordered_map/unordered_map/emplace.md @@ -41,6 +41,7 @@ constexpr pair emplace(Args&&... args); // (1) C++26 ## 備考 +- この関数が例外を送出した場合、コンテナは何の効果も持たない。 - この関数が呼ばれた後も、当該コンテナ内の要素を指す参照は無効にはならない。 なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 @@ -161,5 +162,7 @@ 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) +- [LWG Issue 1253. invalidation of iterators and `emplace` vs. `insert` inconsistence in assoc. containers](https://cplusplus.github.io/LWG/issue1253) + - C++11で、単一要素の挿入時に例外が送出された場合に効果を持たないという保証と、イテレータ・参照が無効化されないという保証が、`insert()`だけでなく`emplace()`にも及ぶことが明記された - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [LWG Issue 2156. Unordered containers' reserve(n) reserves for n-1 elements](https://wg21.cmeerw.net/lwg/issue2156) diff --git a/reference/unordered_map/unordered_multimap/emplace.md b/reference/unordered_map/unordered_multimap/emplace.md index 01973672f9..3429dd4bc8 100644 --- a/reference/unordered_map/unordered_multimap/emplace.md +++ b/reference/unordered_map/unordered_multimap/emplace.md @@ -39,6 +39,7 @@ constexpr iterator emplace(Args&&... args); // (1) C++26 ## 備考 +- この関数が例外を送出した場合、コンテナは何の効果も持たない。 - この関数が呼ばれた後も、当該コンテナ内の要素を指す参照は無効にはならない。 なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 diff --git a/reference/unordered_set/unordered_multiset/emplace.md b/reference/unordered_set/unordered_multiset/emplace.md index db3ed4ff23..3f0eeba1f4 100644 --- a/reference/unordered_set/unordered_multiset/emplace.md +++ b/reference/unordered_set/unordered_multiset/emplace.md @@ -43,6 +43,7 @@ constexpr iterator emplace(Args&&... args); // (1) C++26 ## 備考 +- この関数が例外を送出した場合、コンテナは何の効果も持たない。 - この関数が呼ばれた後も、当該コンテナ内の要素を指す参照は無効にはならない。 なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 diff --git a/reference/unordered_set/unordered_set/emplace.md b/reference/unordered_set/unordered_set/emplace.md index a80892bc53..45dde60b25 100644 --- a/reference/unordered_set/unordered_set/emplace.md +++ b/reference/unordered_set/unordered_set/emplace.md @@ -45,6 +45,7 @@ constexpr pair emplace(Args&&... args); // (1) C++26 ## 備考 +- この関数が例外を送出した場合、コンテナは何の効果も持たない。 - この関数が呼ばれた後も、当該コンテナ内の要素を指す参照は無効にはならない。 なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 @@ -177,3 +178,5 @@ 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) +- [LWG Issue 1253. invalidation of iterators and `emplace` vs. `insert` inconsistence in assoc. containers](https://cplusplus.github.io/LWG/issue1253) + - C++11で、単一要素の挿入時に例外が送出された場合に効果を持たないという保証と、イテレータ・参照が無効化されないという保証が、`insert()`だけでなく`emplace()`にも及ぶことが明記された