Skip to content

Commit 0353f38

Browse files
committed
mdspan/aligned_accessor: 全メンバ P2897R7(#1380)
1 parent c763f14 commit 0353f38

File tree

5 files changed

+179
-4
lines changed

5 files changed

+179
-4
lines changed

reference/mdspan/aligned_accessor.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ namespace std {
3737
3838
| 名前 | 説明 | 対応バージョン |
3939
|------|------|----------------|
40-
| [`(constructor)`](aligned_accessor/op_constructor.md.nolink) | コンストラクタ | C++26 |
40+
| [`(constructor)`](aligned_accessor/op_constructor.md) | コンストラクタ | C++26 |
4141
| `(destructor)` | デストラクタ | C++26 |
42-
| [`operator default_accessor`](aligned_accessor/op_default_accessor.md.nolink) | [`default_accessor`](default_accessor.md)型への変換演算子 | C++26 |
43-
| [`access`](aligned_accessor/access.md.nolink) | 指定オフセット位置にある要素へアクセスする | C++26 |
44-
| [`offset`](aligned_accessor/offset.md.nolink) | 指定オフセット位置のハンドルを取得する | C++26 |
42+
| [`operator default_accessor`](aligned_accessor/op_default_accessor.md) | [`default_accessor`](default_accessor.md)型への変換演算子 | C++26 |
43+
| [`access`](aligned_accessor/access.md) | 指定オフセット位置にある要素へアクセスする | C++26 |
44+
| [`offset`](aligned_accessor/offset.md) | 指定オフセット位置のハンドルを取得する | C++26 |
4545
4646
4747
## メンバ型
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# access
2+
* mdspan[meta header]
3+
* function[meta id-type]
4+
* std[meta namespace]
5+
* aligned_accessor[meta class]
6+
* cpp26[meta cpp]
7+
8+
```cpp
9+
constexpr reference access(data_handle_type p, size_t i) const noexcept;
10+
```
11+
12+
## 概要
13+
指定オフセット位置にある要素へアクセスする。
14+
15+
16+
## 事前条件
17+
- 半開区間`[0, i+1)`が有効な範囲であり、かつ
18+
- [`is_sufficiently_aligned`](/reference/memory/is_sufficiently_aligned.md)`<byte_alignment>(p)`が`true`であること。
19+
20+
21+
## 効果
22+
`return` [`assume_aligned`](/reference/memory/assume_aligned.md)`<byte_alignment>(p)[i];`と等価
23+
24+
25+
## 例外
26+
投げない
27+
28+
29+
## バージョン
30+
### 言語
31+
- C++26
32+
33+
### 処理系
34+
- [Clang](/implementation.md#clang): ??
35+
- [GCC](/implementation.md#gcc): ??
36+
- [ICC](/implementation.md#icc): ??
37+
- [Visual C++](/implementation.md#visual_cpp): ??
38+
39+
40+
## 参照
41+
- [P2897R7 `aligned_accessor`: An mdspan accessor expressing pointer over-alignment](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2897r7.html)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# offset
2+
* mdspan[meta header]
3+
* function[meta id-type]
4+
* std[meta namespace]
5+
* aligned_accessor[meta class]
6+
* cpp26[meta cpp]
7+
8+
```cpp
9+
constexpr typename offset_policy::data_handle_type
10+
offset(data_handle_type p, size_t i) const noexcept;
11+
```
12+
13+
## 概要
14+
指定オフセット位置のハンドルを取得する。
15+
16+
17+
## 事前条件
18+
- 半開区間`[0, i+1)`が有効な範囲であり、かつ
19+
- [`is_sufficiently_aligned`](/reference/memory/is_sufficiently_aligned.md)`<byte_alignment>(p)`が`true`であること。
20+
21+
22+
## 効果
23+
`return` [`assume_aligned`](/reference/memory/assume_aligned.md)`<byte_alignment>(p) + i;`と等価
24+
25+
26+
## 例外
27+
投げない
28+
29+
30+
## バージョン
31+
### 言語
32+
- C++26
33+
34+
### 処理系
35+
- [Clang](/implementation.md#clang): ??
36+
- [GCC](/implementation.md#gcc): ??
37+
- [ICC](/implementation.md#icc): ??
38+
- [Visual C++](/implementation.md#visual_cpp): ??
39+
40+
41+
## 参照
42+
- [P2897R7 `aligned_accessor`: An mdspan accessor expressing pointer over-alignment](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2897r7.html)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# コンストラクタ
2+
* mdspan[meta header]
3+
* function[meta id-type]
4+
* std[meta namespace]
5+
* aligned_accessor[meta class]
6+
* cpp26[meta cpp]
7+
8+
```cpp
9+
constexpr aligned_accessor() noexcept = default; // (1)
10+
11+
template<class OtherElementType, size_t OtherByteAlignment>
12+
constexpr aligned_accessor(
13+
aligned_accessor<OtherElementType, OtherByteAlignment>) noexcept; // (2)
14+
15+
template<class OtherElementType>
16+
explicit constexpr aligned_accessor(
17+
default_accessor<OtherElementType>) noexcept; // (3)
18+
```
19+
* default_accessor[link ../default_accessor.md]
20+
21+
## 概要
22+
- (1) : デフォルトコンストラクタ
23+
- (2) : 他`aligned_accessor`からの変換コンストラクタ
24+
- (3) : [`default_accessor`](../default_accessor.md)からの変換コンストラクタ
25+
26+
27+
## テンプレートパラメータ制約
28+
- (2) :
29+
- [`is_convertible_v`](/reference/type_traits/is_convertible.md)`<OtherElementType(*)[], element_type(*)[]>`が`true`であること
30+
- `OtherByteAlignment > byte_alignment`
31+
- (3) : [`is_convertible_v`](/reference/type_traits/is_convertible.md)`<OtherElementType(*)[], element_type(*)[]>`が`true`であること
32+
33+
34+
## 例外
35+
投げない
36+
37+
38+
## バージョン
39+
### 言語
40+
- C++26
41+
42+
### 処理系
43+
- [Clang](/implementation.md#clang): ??
44+
- [GCC](/implementation.md#gcc): ??
45+
- [ICC](/implementation.md#icc): ??
46+
- [Visual C++](/implementation.md#visual_cpp): ??
47+
48+
49+
## 参照
50+
- [P2897R7 `aligned_accessor`: An mdspan accessor expressing pointer over-alignment](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2897r7.html)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# operator default_accessor
2+
* mdspan[meta header]
3+
* function template[meta id-type]
4+
* std[meta namespace]
5+
* aligned_accessor[meta class]
6+
* cpp26[meta cpp]
7+
8+
```cpp
9+
template<class OtherElementType>
10+
constexpr operator default_accessor<OtherElementType>() const noexcept;
11+
```
12+
* default_accessor[link ../default_accessor.md]
13+
14+
## 概要
15+
[`default_accessor`](../default_accessor.md)型への変換演算子
16+
17+
18+
## テンプレートパラメータ制約
19+
[`is_convertible_v`](/reference/type_traits/is_convertible.md)`<element_type(*)[], OtherElementType(*)[]>``true`であること
20+
21+
22+
## 効果
23+
`return {};`と等価
24+
25+
26+
## 例外
27+
投げない
28+
29+
30+
## バージョン
31+
### 言語
32+
- C++26
33+
34+
### 処理系
35+
- [Clang](/implementation.md#clang): ??
36+
- [GCC](/implementation.md#gcc): ??
37+
- [ICC](/implementation.md#icc): ??
38+
- [Visual C++](/implementation.md#visual_cpp): ??
39+
40+
41+
## 参照
42+
- [P2897R7 `aligned_accessor`: An mdspan accessor expressing pointer over-alignment](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2897r7.html)

0 commit comments

Comments
 (0)