Skip to content
2 changes: 2 additions & 0 deletions GLOBAL_QUALIFY_LIST.txt
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@
* <unordered_set>[link /reference/unordered_set.md]
* std::unordered_set[link /reference/unordered_set/unordered_set.md]
* <utility>[link /reference/utility.md]
* std::constant_wrapper[link /reference/utility/constant_wrapper.md]
* std::cw[link /reference/utility/constant_wrapper.md]
* std::exchange[link /reference/utility/exchange.md]
* std::forward_like[link /reference/utility/forward_like.md]
* std::forward[link /reference/utility/forward.md]
Expand Down
2 changes: 1 addition & 1 deletion lang/cpp26.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通
- [`<utility>`](/reference/utility.md)に、タイムトラベル最適化を抑止するための観測可能ポイントとして[`std::observable_checkpoint()`](/reference/utility/observable_checkpoint.md)を追加
- [`std::exception_ptr`](/reference/exception/exception_ptr.md)を指定した例外型にキャストする[`std::exception_ptr_cast()`](/reference/exception/exception_ptr_cast.md)関数を追加
- [`<compare>`](/reference/compare.md)に、型の順序を取得する[`std::type_order`](/reference/compare/type_order.md)クラスを追加
- [`<utility>`](/reference/utility.md)に、定数を型として包むことで、関数の引数として渡しても定数式として扱えるようにする定数ラッパー[`std::constant_wrapper`](/reference/utility/constant_wrapper.md)クラスと、それを簡潔に生成する変数テンプレート[`std::cw`](/reference/utility/constant_wrapper.md)を追加


### デバッグ
Expand All @@ -525,7 +526,6 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通
### 型特性
- [`<type_traits>`](/reference/type_traits.md)に、共用体の指定されたメンバがアクティブかを定数式で判定するための関数として[`std::is_within_lifetime()`](/reference/type_traits/is_within_lifetime.md)を追加
- [`<type_traits>`](/reference/type_traits.md)に、仮想継承の関係を判定する[`std::is_virtual_base_of`](/reference/type_traits/is_virtual_base_of.md)を追加
- [`<type_traits>`](/reference/type_traits.md)に、[`std::integral_constant`](/reference/type_traits/integral_constant.md)クラスを置き換える定数ラッパーとして[`std::constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)クラスを追加
- [`std::integer_sequence`](/reference/utility/integer_sequence.md)クラスを[構造化束縛](/lang/cpp17/structured_bindings.md)と[template for文](/lang/cpp26/expansion_statements.md)で使用できるようにするため、タプルインタフェースの特殊化を追加


Expand Down
2 changes: 1 addition & 1 deletion lang/cpp26/feature_test_macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
|`__cpp_lib_bind_front`|`202306L`|[`std::bind_front()`](/reference/functional/bind_front.md)に、非型テンプレート引数として関数を指定するオーバーロードを追加|[`<functional>`](/reference/functional.md)|
|`__cpp_lib_bitset`|`202306L`|[`std::bitset`](/reference/bitset/bitset.md)に、[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を受け取るコンストラクタを追加|[`<bitset>`](/reference/bitset.md)|
|`__cpp_lib_chrono`|`202306L`|[`<chrono>`](/reference/chrono.md)のクラスに、ハッシュ値サポートとして[`std::hash`](/reference/functional/hash.md)の特殊化を追加|[`<chrono>`](/reference/chrono.md)|
|`__cpp_lib_constant_wrapper`|`202506L`|[`<type_traits>`](/reference/type_traits.md)に[`std::constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)を追加|[`<type_traits>`](/reference/type_traits.md)|
|`__cpp_lib_constant_wrapper`|`202606L`|[`<utility>`](/reference/utility.md)に[`std::constant_wrapper`](/reference/utility/constant_wrapper.md)を追加|[`<utility>`](/reference/utility.md)|
|`__cpp_lib_constexpr_algorithms`|`202306L`|[`std::stable_sort()`](/reference/algorithm/stable_sort.md) / [`std::ranges::stable_sort()`](/reference/algorithm/ranges_stable_sort.md)を`constexpr`対応|[`<algorithm>`](/reference/algorithm.md), [`<utility>`](/reference/utility.md)|
|`__cpp_lib_constexpr_atomic`|`202411L`|[`<atomic>`](/reference/atomic.md)ライブラリのアトミック操作を`constexpr`対応|[`<atomic>`](/reference/atomic.md)|
|`__cpp_lib_constexpr_cmath`|`202306L`|[`<cmath>`](/reference/cmath.md)の関数 (特殊関数と丸めモードに依存する関数以外の全て) を`constexpr`対応|[`<cmath>`](/reference/cmath.md), [`<cstdlib>`](/reference/cstdlib.md)|
Expand Down
2 changes: 1 addition & 1 deletion reference/mdspan/canonical-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ constexpr auto canonical-index(S s);
## 効果
以下と等価

- `S`が[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルであるとき、`return` [`cw`](/reference/type_traits/constant_wrapper.md.nolink)`<IndexType(S::value)>`
- `S`が[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルであるとき、`return` [`cw`](/reference/utility/constant_wrapper.md)`<IndexType(S::value)>`
- そうではないとき、`return IndexType(`[`std::move`](/reference/utility/move.md)`(s))`


Expand Down
4 changes: 2 additions & 2 deletions reference/mdspan/canonical-slice.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ if constexpr (is_convertible_v<S, full_extent_t>) {
* canonical-index[link canonical-index.md]
* is_convertible_v[link /reference/type_traits/is_convertible.md]
* is_same_v[link /reference/type_traits/is_same.md]
* constant_wrapper[link /reference/type_traits/constant_wrapper.md.nolink]
* cw[link /reference/type_traits/constant_wrapper.md.nolink]
* constant_wrapper[link /reference/utility/constant_wrapper.md]
* cw[link /reference/utility/constant_wrapper.md]
* std::move[link /reference/utility/move.md]

ここで`is-strided-slice`は、型`S`が[`strided_slice`](strided_slice.md)の特殊化であることを表す説明専用コンセプトとする。
Expand Down
2 changes: 1 addition & 1 deletion reference/mdspan/layout_left/mapping/submdspan_mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ friend constexpr auto submdspan_mapping(

下記を満たす型`S`を、単位ストライド幅スライス型と定義する。

- `S`が[`strided_slice`](../../strided_slice.md)の特殊化であり、`S::stride_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化かつ`S::stride_type::value`が`1`、または
- `S`が[`strided_slice`](../../strided_slice.md)の特殊化であり、`S::stride_type`が[`constant_wrapper`](/reference/utility/constant_wrapper.md)の特殊化かつ`S::stride_type::value`が`1`、または
- `S`が[`full_extent_t`](../../full_extent_t.md)

説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ friend constexpr auto submdspan_mapping(

下記を満たす型`S`を、単位ストライド幅スライス型と定義する。

- `S`が[`strided_slice`](../../strided_slice.md)の特殊化であり、`S::stride_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化かつ`S::stride_type::value`が`1`、または
- `S`が[`strided_slice`](../../strided_slice.md)の特殊化であり、`S::stride_type`が[`constant_wrapper`](/reference/utility/constant_wrapper.md)の特殊化かつ`S::stride_type::value`が`1`、または
- `S`が[`full_extent_t`](../../full_extent_t.md)

説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。
Expand Down
2 changes: 1 addition & 1 deletion reference/mdspan/layout_right/mapping/submdspan_mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ friend constexpr auto submdspan_mapping(

下記を満たす型`S`を、単位ストライド幅スライス型と定義する。

- `S`が[`strided_slice`](../../strided_slice.md)の特殊化であり、`S::stride_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化かつ`S::stride_type::value`が`1`、または
- `S`が[`strided_slice`](../../strided_slice.md)の特殊化であり、`S::stride_type`が[`constant_wrapper`](/reference/utility/constant_wrapper.md)の特殊化かつ`S::stride_type::value`が`1`、または
- `S`が[`full_extent_t`](../../full_extent_t.md)

説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ friend constexpr auto submdspan_mapping(

下記を満たす型`S`を、単位ストライド幅スライス型と定義する。

- `S`が[`strided_slice`](../../strided_slice.md)の特殊化であり、`S::stride_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化かつ`S::stride_type::value`が`1`、または
- `S`が[`strided_slice`](../../strided_slice.md)の特殊化であり、`S::stride_type`が[`constant_wrapper`](/reference/utility/constant_wrapper.md)の特殊化かつ`S::stride_type::value`が`1`、または
- `S`が[`full_extent_t`](../../full_extent_t.md)

説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。
Expand Down
2 changes: 1 addition & 1 deletion reference/mdspan/sliceable-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ concept sliceable-mapping = see below;
- オブジェクトのパック`invalid_slices` : `sizeof...(invalid_slices) == M_rank`であり、`invalid_slices...[k]`のcv非修飾型が下記いずれでもない整数`k`が存在する
- 型`IT`
- [`full_extent_t`](full_extent_t.md)
- [`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化
- [`constant_wrapper`](/reference/utility/constant_wrapper.md)の特殊化
- [`strided_slice`](strided_slice.md)の特殊化

下記を満たすとき、型`M`はスライス可能レイアウトマッピング(sliceable layout mapping)要件を満たす。
Expand Down
12 changes: 6 additions & 6 deletions reference/mdspan/submdspan_canonicalize_slices.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ namespace std {
- `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`<decltype(std::move(ls)), IndexType> && ...)`が`true`

### 正則`submdspan`スライス型
符号付きもしくは符号なし整数型`IndexType`に対して、型`S`が`IndexType`もしくは値`0`以上の任意の値`v`を保持する[`constant_wrapper<v>`](/reference/type_traits/constant_wrapper.md.nolink)であるとき、型`S`は`IndexType`の正則`submdspan`インデクス型となる。
符号付きもしくは符号なし整数型`IndexType`に対して、型`S`が`IndexType`もしくは値`0`以上の任意の値`v`を保持する[`constant_wrapper<v>`](/reference/utility/constant_wrapper.md)であるとき、型`S`は`IndexType`の正則`submdspan`インデクス型となる。

符号付きもしくは符号なし整数型`IndexType`に対して、下記のうちただ1つだけを満たすとき、型`S`は`IndexType`の正則`submdspan`スライス型(canonical `submdspan` slice type)となる。

- `S`が[`full_extent_t`](full_extent_t.md)
- `S`が`IndexType`の正則`submdspan`インデクス型である
- `S`が[`strided_slice`](strided_slice.md)の特殊化であり、下記を全て満たす
- `S::offset_type`, `S::extent_type`, `S::stride_type`が、全て`IndexType`の正則`submdspan`インデクス型である
- `S::stride_type`および`S::extent_type`がいずれも[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化であり、`S::stride_type::value`が`0`より大きい
- `S::stride_type`および`S::extent_type`がいずれも[`constant_wrapper`](/reference/utility/constant_wrapper.md)の特殊化であり、`S::stride_type::value`が`0`より大きい

### 縮約スライス型と`MAP_RANK`
ある型が[`full_extent_t`](full_extent_t.md)ないし[`strided_slice`](strided_slice.md)の特殊化いずれでもないとき、縮約スライス型(collapsing slice type)となる。
Expand All @@ -49,10 +49,10 @@ namespace std {
[`extents`](extents.md)の特殊化である型`E`に対して、型`S`が`E::index_type`の正則スライス型であり、かつ`E::static_extent(k)`に等しい`x`に対して`x`が`dynamic_extent`に等しいか下記を満たすとき、型`S`は`E`の`k`番目次元の有効`submdspan`スライス型(valid `submdspan` slice type)となる。

- `S`が[`strided_slice`](strided_slice.md)の特殊化であるとき :
- `S::offset_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化であるとき、`S::offset_type::value`が`x`以下
- `S::extent_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化であるとき、`S::extent_type::value`が`x`以下
- `S::offset_type`および`S::extent_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化であるとき、`S::offset_type::value + S::extent_type::value`が`x`以下
- `S`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化であるとき、`S::value`が`x`より小さい
- `S::offset_type`が[`constant_wrapper`](/reference/utility/constant_wrapper.md)の特殊化であるとき、`S::offset_type::value`が`x`以下
- `S::extent_type`が[`constant_wrapper`](/reference/utility/constant_wrapper.md)の特殊化であるとき、`S::extent_type::value`が`x`以下
- `S::offset_type`および`S::extent_type`が[`constant_wrapper`](/reference/utility/constant_wrapper.md)の特殊化であるとき、`S::offset_type::value + S::extent_type::value`が`x`以下
- `S`が[`constant_wrapper`](/reference/utility/constant_wrapper.md)の特殊化であるとき、`S::value`が`x`より小さい

### 有効`submdspan`スライス
[`extents`](extents.md)の特殊化である型`E`のオブジェクト`e`と、型`S`のオブジェクト`s`に対して、下記を満たすとき`s`は`e`の`k`番目次元の有効`submdspan`スライス(valid `submdspan` slice)となる。
Expand Down
4 changes: 2 additions & 2 deletions reference/mdspan/submdspan_extents.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ auto [...slices] = submdspan_canonicalize_slices(src, raw_slices...);
- [`SubExtents::rank()`](extents/rank.md)が[`MAP_RANK`](submdspan_canonicalize_slices.md)`(slices, Extents::rank())`に等しく、かつ
- `slices...[k]`の型が[縮約スライス型(collapsing slice type)](submdspan_canonicalize_slices.md)ではない`Extents`の各次元インデクス`k`に対して、説明用の`S_k`を`slices...[k]`の型としたとき、[`SubExtents::static_extent`](extents/static_extent.md)`(`[`MAP_RANK`](submdspan_canonicalize_slices.md)`(slices, k))`が下記と等しいこと。
- 型`S_k`が[`full_extent_t`](full_extent_t.md)のとき、[`SubExtents::static_extent`](extents/static_extent.md)`(k)`、そうでなければ、
- 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化かつメンバ型`S_k::extent_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)`<IndexType(0)>`のとき、値`0`、そうでなければ
- 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化かつメンバ型`extent_type`および`stride_type`がいずれも[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化であるとき、`1 + ((S_k::extent_type::value - 1) / S_k::stride_type::value)`
- 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化かつメンバ型`S_k::extent_type`が[`constant_wrapper`](/reference/utility/constant_wrapper.md)`<IndexType(0)>`のとき、値`0`、そうでなければ
- 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化かつメンバ型`extent_type`および`stride_type`がいずれも[`constant_wrapper`](/reference/utility/constant_wrapper.md)の特殊化であるとき、`1 + ((S_k::extent_type::value - 1) / S_k::stride_type::value)`
- そうでなければ、[`dynamic_extent`](/reference/span/dynamic_extent.md)

以下を満たす`SubExtents`型の値`ext`を返す。
Expand Down
8 changes: 8 additions & 0 deletions reference/utility.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@
| [`constant_arg`](utility/constant_arg_t.md) | 定数引数を表現するためのタグ値 (variable template) | C++26 |


## 定数のラッパー

| 名前 | 説明 | 対応バージョン |
|------|------|----------------|
| [`constant_wrapper`](utility/constant_wrapper.md) | 定数を型として包むラッパー (class template) | C++26 |
| [`cw`](utility/constant_wrapper.md) | `constant_wrapper`を簡潔に生成する変数テンプレート (variable template) | C++26 |


## コンパイル時の整数シーケンス

| 名前 | 説明 | 対応バージョン |
Expand Down
Loading
Loading