|
| 1 | +# aligned_accessor |
| 2 | +* mdspan[meta header] |
| 3 | +* class template[meta id-type] |
| 4 | +* std[meta namespace] |
| 5 | +* cpp26[meta cpp] |
| 6 | + |
| 7 | +```cpp |
| 8 | +namespace std { |
| 9 | + template<class ElementType, size_t ByteAlignment> |
| 10 | + class aligned_accessor; |
| 11 | +} |
| 12 | +``` |
| 13 | +
|
| 14 | +## 概要 |
| 15 | +`aligned_accessor`は、多次元配列ビュー[`mdspan`](mdspan.md)を介した要素アクセスにおいて、メモリアドレスに対するアライメント保証を与える。それ以外の動作は[`default_accessor`](default_accessor.md)と等価である。 |
| 16 | +
|
| 17 | +`ElementType`は抽象クラス型もしくは配列型のいずれでもない完全型であること。 |
| 18 | +
|
| 19 | +`aligned_accessor`は[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であり、[`semiregular`](/reference/concepts/semiregular.md)のモデルである。 |
| 20 | +
|
| 21 | +`aligned_accessor`は[アクセサポリシー要件](AccessorPolicy.md)を満たす。 |
| 22 | +
|
| 23 | +
|
| 24 | +## 適格要件 |
| 25 | +- `ByteAlignment`は2のべき乗であること |
| 26 | +- `ByteAlignment >=` [`alignof`](/lang/cpp11/alignof.md)`(ElementType)` |
| 27 | +
|
| 28 | +
|
| 29 | +## メンバ変数 |
| 30 | +
|
| 31 | +| 名前 | 説明 | 対応バージョン | |
| 32 | +|------|------|----------------| |
| 33 | +| `static constexpr size_t byte_alignment` | `ByteAlignment` | C++26 | |
| 34 | +
|
| 35 | +
|
| 36 | +## メンバ関数 |
| 37 | +
|
| 38 | +| 名前 | 説明 | 対応バージョン | |
| 39 | +|------|------|----------------| |
| 40 | +| [`(constructor)`](aligned_accessor/op_constructor.md.nolink) | コンストラクタ | C++26 | |
| 41 | +| `(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 | |
| 45 | +
|
| 46 | +
|
| 47 | +## メンバ型 |
| 48 | +
|
| 49 | +| 名前 | 説明 | 対応バージョン | |
| 50 | +|------|------|----------------| |
| 51 | +| `offset_policy` | [`default_accessor<ElementType>`](default_accessor.md) | C++26 | |
| 52 | +| `element_type` | `ElementType` | C++26 | |
| 53 | +| `reference` | `ElementType&` | C++26 | |
| 54 | +| `data_handle_type` | `ElementType*` | C++26 | |
| 55 | +
|
| 56 | +
|
| 57 | +## バージョン |
| 58 | +### 言語 |
| 59 | +- C++26 |
| 60 | +
|
| 61 | +### 処理系 |
| 62 | +- [Clang](/implementation.md#clang): ?? |
| 63 | +- [GCC](/implementation.md#gcc): ?? |
| 64 | +- [ICC](/implementation.md#icc): ?? |
| 65 | +- [Visual C++](/implementation.md#visual_cpp): ?? |
| 66 | +
|
| 67 | +
|
| 68 | +## 関連項目 |
| 69 | +- [`mdspan`](mdspan.md) |
| 70 | +- [`default_accessor`](default_accessor.md) |
| 71 | +
|
| 72 | +
|
| 73 | +## 参照 |
| 74 | +- [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