Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
b6c55ca
to_string, to_wstring, apply : 機能テストマクロが更新されてなかったのでC++29で修正され、C++26に遡及適用
faithandbrave Aug 27, 2026
8831ad1
atomic::notify / wait系 : LWG Issueを追加
faithandbrave Aug 27, 2026
21c1cde
is_clock : C1::is_steadyが定数式で使用できることが要件に追加された。未規定だったのもの明確化なので遡及適用
faithandbrave Aug 27, 2026
6b8c6e9
packaged_taskとpromiseの代入演算子 : 共有状態の放棄についてC++29で仕様の書き方が整理されC++11に遡及適用された
faithandbrave Aug 27, 2026
cb8f76d
tupleのコンストラクタ : アロケータ構築の対象が、参照型ではない要素のみであることが規定され、C++29からC++11に遡及適用された
faithandbrave Aug 27, 2026
e5dd220
NULL : 展開される値がリテラルであることが規定され、遡及適用された。これによって`(void*)0`は許可されなくなった
faithandbrave Aug 27, 2026
77e735f
as_awaitable : pが左辺値でない場合は不適格になった
faithandbrave Aug 27, 2026
c4a47aa
spawn_future : completion_signatures_of_tにenvが渡されるようになった
faithandbrave Aug 27, 2026
bf88ad9
execution::when_all : 存在しないEnvの変わりにenv_of_tが使われるようになった
faithandbrave Aug 27, 2026
ae01054
run-loop-sender : 潜在的な例外送出の規定が削除された
faithandbrave Aug 27, 2026
2b8e246
basic_const_iteratorの比較演算子 : 右辺用のテンプレートパラメータが追加された
faithandbrave Aug 27, 2026
b25c0dc
move_iteratorのコンストラクタ : C++29でデフォルトコンストラクタに要件追加
faithandbrave Aug 27, 2026
3435262
iteratorの各アクセッサ関数 : 別なヘッダでも使える一覧を記載
faithandbrave Aug 27, 2026
7944348
lazy_split_view : 末尾の空RangeについてC++29で入ったがC++20に遡及適用
faithandbrave Aug 27, 2026
39e3561
ranges::to : emplaceの代わりにemplace_hintが使われるようになった。遡及適用
faithandbrave Aug 27, 2026
e80d61c
memory_order : Read-Modify-Write操作が読み取る値の仕様を記載
faithandbrave Aug 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lang/cpp26/feature_test_macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
|`__cpp_lib_algorithm_default_value_type`|`202603L`|一部アルゴリズムに、値を波カッコ初期化で渡せるよう制約を追加 (P3787R2で[`uninitialized_fill`](/reference/memory/uninitialized_fill.md)/[`uninitialized_fill_n`](/reference/memory/uninitialized_fill_n.md)を追加)|[`<algorithm>`](/reference/algorithm.md), [`<ranges>`](/reference/ranges.md), [`<string>`](/reference/string.md), [`<deque>`](/reference/deque.md), [`<list>`](/reference/list.md), [`<forward_list>`](/reference/forward_list.md), [`<vector>`](/reference/vector.md), [`<memory>`](/reference/memory.md)|
|`__cpp_lib_aligned_accessor`|`202411L`|[`<mdspan>`](/reference/mdspan.md)に、要素アクセスにアライメント保証を与える[`std::aligned_accessor`](/reference/mdspan/aligned_accessor.md)を追加|[`<mdspan>`](/reference/mdspan.md)|
|`__cpp_lib_associative_heterogeneous_insertion`|`202306L`|連想コンテナの一部メンバ関数に、一時オブジェクト生成のコストを抑える拡張を追加|[`<map>`](/reference/map.md), [`<set>`](/reference/set.md), [`<unordered_map>`](/reference/unordered_map.md), [`<unordered_set>`](/reference/unordered_set.md)|
|`__cpp_lib_apply`|`202506L`| [`std::apply`](/reference/tuple/apply.md)の戻り値型推論をやめて、戻り値型用の[`std::apply_result`](/reference/tuple/apply_result.md.nolink)クラスを追加|[`<tuple>`](/reference/tuple.md), [`<type_traits>`](/reference/type_traits.md)|
|`__cpp_lib_apply`|`202603L`| [`std::apply`](/reference/tuple/apply.md)の戻り値型推論をやめて、戻り値型用の[`std::apply_result`](/reference/tuple/apply_result.md.nolink)クラスを追加 (`202506L`)。[`<meta>`](/reference/meta.md)にも対応する[`std::meta::apply_result`](/reference/meta/apply_result.md)などを追加 (`202603L`)|[`<tuple>`](/reference/tuple.md), [`<type_traits>`](/reference/type_traits.md), [`<meta>`](/reference/meta.md)|
|`__cpp_lib_atomic_min_max`|`202506L`|[`std::atomic`](/reference/atomic/atomic.md)オブジェクトに対する2つの値の最大値・最小値を取得する関数を追加|[`<atomic>`](/reference/atomic.md)|
|`__cpp_lib_atomic_reductions`|`202506L`|[`std::atomic`](/reference/atomic/atomic.md)と[`std::atomic_ref`](/reference/atomic/atomic_ref.md)に高速な縮約用の操作を追加|[`<atomic>`](/reference/atomic.md)|
|`__cpp_lib_atomic_ref`|`202411L`|[`std::atomic_ref`](/reference/atomic/atomic_ref.md)に[`address()`](/reference/atomic/atomic_ref/address.md)メンバ関数を追加|[`<atomic>`](/reference/atomic.md)|
Expand All @@ -68,6 +68,7 @@
|`__cpp_lib_constexpr_queue`|`202502L`|[`std::queue`](/reference/queue/queue.md) / [`std::priority_queue`](/reference/queue/priority_queue.md)を`constexpr`対応|[`<queue>`](/reference/queue.md)|
|`__cpp_lib_constexpr_set`|`202502L`|[`std::set`](/reference/set/set.md) / [`std::multiset`](/reference/set/multiset.md)を`constexpr`対応|[`<set>`](/reference/set.md)|
|`__cpp_lib_constexpr_stack`|`202502L`|[`std::stack`](/reference/stack/stack.md)を`constexpr`対応|[`<stack>`](/reference/stack.md)|
|`__cpp_lib_constexpr_string`|`202511L`|[`std::to_string()`](/reference/string/to_string.md)・[`std::to_wstring()`](/reference/string/to_wstring.md)の整数版が`constexpr`対応|[`<string>`](/reference/string.md)|
|`__cpp_lib_constexpr_unordered_map`|`202502L`|[`std::unordered_map`](/reference/unordered_map/unordered_map.md) / [`std::unordered_multimap`](/reference/unordered_map/unordered_multimap.md)を`constexpr`対応|[`<unordered_map>`](/reference/unordered_map.md)|
|`__cpp_lib_constexpr_unordered_set`|`202502L`|[`std::unordered_set`](/reference/unordered_set/unordered_set.md) / [`std::unordered_multiset`](/reference/unordered_set/unordered_multiset.md)を`constexpr`対応|[`<unordered_set>`](/reference/unordered_set.md)|
|`__cpp_lib_constrained_equality`|`202411L`|[`std::reference_wrapper`](/reference/functional/reference_wrapper.md)に、比較演算子[`==`](/reference/functional/reference_wrapper/op_equal.md)と[`<=>`](/reference/functional/reference_wrapper/op_compare_3way.md)を追加|[`<utility>`](/reference/utility.md), [`<tuple>`](/reference/tuple.md), [`<optional>`](/reference/optional.md), [`<variant>`](/reference/variant.md), [`<expected>`](/reference/expected.md)|
Expand Down Expand Up @@ -195,6 +196,10 @@
- [SD-FeatureTest: Feature-Test Macros and Policies - isocpp](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations)
- [LWG Issue 4286. Some more feature-test macros for fully freestanding features are not marked freestanding](https://cplusplus.github.io/LWG/issue4286)
- C++26で、`__cpp_lib_aligned_accessor`・`__cpp_lib_array_constexpr`・`__cpp_lib_clamp`・`__cpp_lib_constexpr_numeric`・`__cpp_lib_function_ref`・`__cpp_lib_gcd_lcm`・`__cpp_lib_integer_comparison_functions`・`__cpp_lib_is_sufficiently_aligned`・`__cpp_lib_ranges_contains`・`__cpp_lib_ranges_enumerate`・`__cpp_lib_ranges_find_last`・`__cpp_lib_ranges_fold`・`__cpp_lib_ranges_iota`・`__cpp_lib_ranges_starts_ends_with`・`__cpp_lib_robust_nonmodifying_seq_ops`・`__cpp_lib_sample`・`__cpp_lib_saturation_arithmetic`が、フリースタンディング機能に対応するマクロとしてマークされた(あわせて`<memory>`の`is_sufficiently_aligned`もフリースタンディング指定された)
- [LWG Issue 4531. Should there be a feature-test macro update for constexpr `std::to_(w)string`?](https://cplusplus.github.io/LWG/issue4531)
- [`std::to_string()`](/reference/string/to_string.md)の`constexpr`対応がどの機能テストマクロにも反映されていなかったため、`__cpp_lib_constexpr_string`が`202511L`に更新された。このIssueは規格としてはC++29のワーキングドラフトへ適用されたが、C++26で追加された機能に対する修正であるため、C++26へ遡及して適用される
- [LWG Issue 4567. Feature test macro value for `apply_result`, `is_applicable`](https://cplusplus.github.io/LWG/issue4567)
- `__cpp_lib_apply`の値が整理され、[P1317R2](https://wg21.link/P1317R2)に対応した場合は`202506L`、[P3795R2](https://wg21.link/P3795R2)による[`<meta>`](/reference/meta.md)側の対応も行った場合は`202603L`となった。このIssueは規格としてはC++29のワーキングドラフトへ適用されたが、いずれもC++26で追加された機能に対する修正であるため、C++26へ遡及して適用される
- [LWG Issue 4550. Need new feature test macros for `<stdckdint.h>` and `<stdbit.h>`](https://cplusplus.github.io/LWG/issue4550)
- C++26で、`__cpp_lib_stdbit_h`と`__cpp_lib_stdckdint_h`が追加された
- [P3371R5 Fix C++26 BLAS rank updates consistency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3371r5.html)
Expand Down
2 changes: 2 additions & 0 deletions reference/atomic/atomic/notify_all.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,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 3417. Missing `volatile` atomic deprecations](https://cplusplus.github.io/LWG/issue3417)
- `volatile`修飾されたオーバーロードが`is_always_lock_free``true`である場合にのみオーバーロード解決に参加することが規定された。この制約はほかの`volatile`版メンバ関数には当初からあったが、この関数には記載が漏れていた。規格としてはC++29のワーキングドラフトへ適用されたが、記載漏れの修正であるため、この関数が追加されたC++20へ遡及して適用される
2 changes: 2 additions & 0 deletions reference/atomic/atomic/notify_one.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,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 3417. Missing `volatile` atomic deprecations](https://cplusplus.github.io/LWG/issue3417)
- `volatile`修飾されたオーバーロードが`is_always_lock_free`が`true`である場合にのみオーバーロード解決に参加することが規定された。この制約はほかの`volatile`版メンバ関数には当初からあったが、この関数には記載が漏れていた。規格としてはC++29のワーキングドラフトへ適用されたが、記載漏れの修正であるため、この関数が追加されたC++20へ遡及して適用される
2 changes: 2 additions & 0 deletions reference/atomic/atomic/wait.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,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 3417. Missing `volatile` atomic deprecations](https://cplusplus.github.io/LWG/issue3417)
- `volatile`修飾されたオーバーロードが`is_always_lock_free`が`true`である場合にのみオーバーロード解決に参加することが規定された。この制約はほかの`volatile`版メンバ関数には当初からあったが、この関数には記載が漏れていた。規格としてはC++29のワーキングドラフトへ適用されたが、記載漏れの修正であるため、この関数が追加されたC++20へ遡及して適用される
8 changes: 8 additions & 0 deletions reference/atomic/memory_order.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ int main()


## 備考
### Read-Modify-Write操作が読み取る値
読み込みと書き込みを同時に行う操作 (Read-Modify-Write操作。[`fetch_add()`](/reference/atomic/atomic/fetch_add.md)や[`compare_exchange_weak()`](/reference/atomic/atomic/compare_exchange_weak.md)など) は、指定したメモリオーダーによらず、対象のアトミックオブジェクトの変更順序において、自身の副作用の直前にある副作用が書き込んだ値を読み取る。

これにより、複数のスレッドが同じアトミックオブジェクトに対してRead-Modify-Write操作を行っても、それらが同じ値を読み取ることはない。

### `consume`列挙値
非推奨化された`consume`列挙値の挙動はacquire操作と似ているが、それより弱い順序付けでの読み込みを行うことを指示する。acquire操作は後続の全ての操作に対して順序付けを行うのに対し、consume操作は読み込まれた値に依存(ただし条件分岐による依存は除く)する操作のみに順序付けを保証する点が異なる。
複雑なconsume操作を正しく実装するC++コンパイラは登場せず、より単純なacquire操作として扱われていた。C++20では仕様再検討に伴う一時的な利用回避が宣言され、最終的には役に立たないとの判断からC++26で非推奨となった。

Expand Down Expand Up @@ -125,3 +131,5 @@ int main()
- [P0371R1 Temporarily discourage `memory_order_consume`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0371r1.html)
- [P3475R2 Defang and deprecate memory_order::consume](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3475r2.pdf)
- C++26で`memory_order::consume`列挙子を非推奨化。
- [LWG Issue 4521. Improve [atomics.order] p10 to have a consistent way with [intro.races]](https://cplusplus.github.io/LWG/issue4521)
- Read-Modify-Write操作が読み取る値の規定が、「変更順序において書き込みより前に書かれた最後の値」から「Read-Modify-Write操作の副作用の直前の副作用による値」という表現へ改められた。メモリモデルのほかの箇所と用語を揃えるためであり、規格としてはC++29のワーキングドラフトへ適用されたが、文言の明確化であるためC++11へ遡及して適用される
7 changes: 6 additions & 1 deletion reference/chrono/is_clock.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Clock要件を満たすには、以下が必要である:
| `C1::period` | [`std::ratio`](/reference/ratio/ratio.md)の特殊化 | クロックの時間周期 (秒ベース) |
| `C1::duration` | [`chrono::duration`](duration.md)`<C1::rep, C1::period>` | クロックの`duation`型 |
| `C1::time_point` | [`chrono::time_point`](time_point.md)`<C1>`もしくは[`chrono::time_point`](time_point.md)`<C2, C1::duration>` | クロックの`time_point`型。`C1`と`C2`は同じエポックを参照する |
| `C1::is_steady` | `const bool` | `t1 <= t2`が常に真であり (注:時間が戻らない)、時間間隔が常に一定である場合に`true`、そうでなければ`false` |
| `C1::is_steady` | `const bool` | `t1 <= t2`が常に真であり (注:時間が戻らない)、時間間隔が常に一定である場合に`true`、そうでなければ`false`。定数式で使用できることが要求される |
| `C1::now()` | `C1::time_point` | 現在の時間点を表す`time_point`オブジェクトを返す |

ここで、以下のように定義する:
Expand Down Expand Up @@ -82,3 +82,8 @@ int main()
- [Clang](/implementation.md#clang): 9.0 [mark noimpl]
- [GCC](/implementation.md#gcc): 9.2 [mark noimpl]
- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl]


## 参照
- [LWG Issue 4487. Is member `is_steady` of a Cpp17Clock type required to be usable in constant expressions?](https://cplusplus.github.io/LWG/issue4487)
- `C1::is_steady`が定数式で使用できることが要件に追加された。それ以前は`const bool`とだけ規定されており、利用者定義のクロックに対して同じ要求があるかが不明確だった。規格としてはC++29のワーキングドラフトへ適用されたが、未規定だった点の明文化であるため、Cpp17Clock要件が規定されたC++11へ遡及して適用される
8 changes: 5 additions & 3 deletions reference/cstddef/null.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ int main() {
```

## 備考
C++98において、「ヌルポインタ定数」は「値が0になる整数定数式」と定義されていた。したがって、マクロ`NULL`の値として`0`や`0L`は規格に適合するが、`(void*)0`は整数定数式ではないため適合しない

C++11では、「ヌルポインタ定数」の定義に「[`std::nullptr_t`](/reference/cstddef/nullptr_t.md)型のprvalue」が追加されたため、`nullptr`も規格に適合する。しかし、`NULL`の値の型が変わるとコードの互換性を損なうことから、当面の間`NULL`の値は整数定数式であると思われる。C++11以降は`NULL`ではなく[`nullptr`](/lang/cpp11/nullptr.md)を使用するとよい。
- マクロ`NULL`が展開されるヌルポインタ定数はリテラルであることが規定されている。したがって`nullptr`、`0`、`0L`は規格に適合するが、`(void*)0`は適合しない
- C++98において、「ヌルポインタ定数」は「値が0になる整数定数式」と定義されていた。したがって、マクロ`NULL`の値として`0`や`0L`は規格に適合するが、`(void*)0`は整数定数式ではないため適合しない。
- C++11では、「ヌルポインタ定数」の定義に「[`std::nullptr_t`](/reference/cstddef/nullptr_t.md)型のprvalue」が追加されたため、`nullptr`も規格に適合する。しかし、`NULL`の値の型が変わるとコードの互換性を損なうことから、当面の間`NULL`の値は整数定数式であると思われる。C++11以降は`NULL`ではなく[`nullptr`](/lang/cpp11/nullptr.md)を使用するとよい。

## 関連項目
- [C++11 `nullptr`](/lang/cpp11/nullptr.md)

## 参照
- [Does any major C++ implementation actually define `NULL` as `nullptr`? - Stack Overflow](https://stackoverflow.com/questions/61699775/does-any-major-c-implementation-actually-define-null-as-nullptr)
- [LWG Issue 4182. Definition of `NULL` is too broad](https://cplusplus.github.io/LWG/issue4182)
- `NULL`が展開されるヌルポインタ定数はリテラルであることが規定された。それ以前は「処理系定義のヌルポインタ定数」としか規定されておらず、任意の定数式を許すように読めたため。規格としてはC++29のワーキングドラフトへ適用されたが、処理系に対する制約の明文化であり、既存の処理系はいずれも満たしているため、C++98へ遡及して適用される
8 changes: 6 additions & 2 deletions reference/execution/execution/as_awaitable.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ Promise型`p`をもつコルーチンにおいて、Await式`co_await as_awaitab


## 効果
説明用の式`expr`と左辺値`p`に対して、型`Expr`を`decltype((expr))`、型`Promise`を[`decay_t`](/reference/type_traits/decay.md)`<decltype((p))>`とする。
説明用の式`expr``p`に対して、型`Expr`を`decltype((expr))`、型`Promise`を[`decay_t`](/reference/type_traits/decay.md)`<decltype((p))>`とする。

呼び出し式`as_awaitable(expr, p)`は、`expr`と`p`の評価が不定順で順序付けられることを除いて、下記と等価。
`p`が左辺値ではない場合、呼び出し式`as_awaitable(expr, p)`は不適格となる。

そうでなければ、呼び出し式`as_awaitable(expr, p)`は、`expr`と`p`の評価が不定順で順序付けられることを除いて、下記と等価。

- 適格であるならば、式`expr.as_awaitable(p)`
- 適格要件 : 同式の型を`A`としたとき、[`is-awaitable`](../is-awaitable.md)`<A, Promise> == true`であるべき。
Expand Down Expand Up @@ -263,3 +265,5 @@ value-type await_resume();
- [LWG4361 `awaitable-receiver::set_value` should use Mandates instead of constraints](https://cplusplus.github.io/LWG/issue4361)
- [P3941R4 Scheduler Affinity](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p3941r4.html)
- [P4159R0 Make `sender_in` and `receiver_of` exposition-only](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p4159r0.html)
- [LWG Issue 4359. `as_awaitable(expr, p)` does not define semantics of call if `p` is not an lvalue](https://cplusplus.github.io/LWG/issue4359)
- `p`が左辺値でない場合にこの呼び出しが不適格となることが規定された。それ以前は`p`が左辺値である場合の意味しか規定されておらず、そうでない場合の扱いが不明だった。規格としてはC++29のワーキングドラフトへ適用されたが、未規定だった点の明文化であるため、`as_awaitable`が追加されたC++26へ遡及して適用される
Loading
Loading