-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mdspan/aligned_accessor: 全メンバ P2897R7(#1380)
- Loading branch information
Showing
5 changed files
with
179 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# access | ||
* mdspan[meta header] | ||
* function[meta id-type] | ||
* std[meta namespace] | ||
* aligned_accessor[meta class] | ||
* cpp26[meta cpp] | ||
|
||
```cpp | ||
constexpr reference access(data_handle_type p, size_t i) const noexcept; | ||
``` | ||
## 概要 | ||
指定オフセット位置にある要素へアクセスする。 | ||
## 事前条件 | ||
- 半開区間`[0, i+1)`が有効な範囲であり、かつ | ||
- [`is_sufficiently_aligned`](/reference/memory/is_sufficiently_aligned.md)`<byte_alignment>(p)`が`true`であること。 | ||
## 効果 | ||
`return` [`assume_aligned`](/reference/memory/assume_aligned.md)`<byte_alignment>(p)[i];`と等価 | ||
## 例外 | ||
投げない | ||
## バージョン | ||
### 言語 | ||
- C++26 | ||
### 処理系 | ||
- [Clang](/implementation.md#clang): ?? | ||
- [GCC](/implementation.md#gcc): ?? | ||
- [ICC](/implementation.md#icc): ?? | ||
- [Visual C++](/implementation.md#visual_cpp): ?? | ||
## 参照 | ||
- [P2897R7 `aligned_accessor`: An mdspan accessor expressing pointer over-alignment](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2897r7.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# offset | ||
* mdspan[meta header] | ||
* function[meta id-type] | ||
* std[meta namespace] | ||
* aligned_accessor[meta class] | ||
* cpp26[meta cpp] | ||
|
||
```cpp | ||
constexpr typename offset_policy::data_handle_type | ||
offset(data_handle_type p, size_t i) const noexcept; | ||
``` | ||
## 概要 | ||
指定オフセット位置のハンドルを取得する。 | ||
## 事前条件 | ||
- 半開区間`[0, i+1)`が有効な範囲であり、かつ | ||
- [`is_sufficiently_aligned`](/reference/memory/is_sufficiently_aligned.md)`<byte_alignment>(p)`が`true`であること。 | ||
## 効果 | ||
`return` [`assume_aligned`](/reference/memory/assume_aligned.md)`<byte_alignment>(p) + i;`と等価 | ||
## 例外 | ||
投げない | ||
## バージョン | ||
### 言語 | ||
- C++26 | ||
### 処理系 | ||
- [Clang](/implementation.md#clang): ?? | ||
- [GCC](/implementation.md#gcc): ?? | ||
- [ICC](/implementation.md#icc): ?? | ||
- [Visual C++](/implementation.md#visual_cpp): ?? | ||
## 参照 | ||
- [P2897R7 `aligned_accessor`: An mdspan accessor expressing pointer over-alignment](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2897r7.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# コンストラクタ | ||
* mdspan[meta header] | ||
* function[meta id-type] | ||
* std[meta namespace] | ||
* aligned_accessor[meta class] | ||
* cpp26[meta cpp] | ||
|
||
```cpp | ||
constexpr aligned_accessor() noexcept = default; // (1) | ||
|
||
template<class OtherElementType, size_t OtherByteAlignment> | ||
constexpr aligned_accessor( | ||
aligned_accessor<OtherElementType, OtherByteAlignment>) noexcept; // (2) | ||
|
||
template<class OtherElementType> | ||
explicit constexpr aligned_accessor( | ||
default_accessor<OtherElementType>) noexcept; // (3) | ||
``` | ||
* default_accessor[link ../default_accessor.md] | ||
## 概要 | ||
- (1) : デフォルトコンストラクタ | ||
- (2) : 他`aligned_accessor`からの変換コンストラクタ | ||
- (3) : [`default_accessor`](../default_accessor.md)からの変換コンストラクタ | ||
## テンプレートパラメータ制約 | ||
- (2) : | ||
- [`is_convertible_v`](/reference/type_traits/is_convertible.md)`<OtherElementType(*)[], element_type(*)[]>`が`true`であること | ||
- `OtherByteAlignment > byte_alignment` | ||
- (3) : [`is_convertible_v`](/reference/type_traits/is_convertible.md)`<OtherElementType(*)[], element_type(*)[]>`が`true`であること | ||
## 例外 | ||
投げない | ||
## バージョン | ||
### 言語 | ||
- C++26 | ||
### 処理系 | ||
- [Clang](/implementation.md#clang): ?? | ||
- [GCC](/implementation.md#gcc): ?? | ||
- [ICC](/implementation.md#icc): ?? | ||
- [Visual C++](/implementation.md#visual_cpp): ?? | ||
## 参照 | ||
- [P2897R7 `aligned_accessor`: An mdspan accessor expressing pointer over-alignment](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2897r7.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# operator default_accessor | ||
* mdspan[meta header] | ||
* function template[meta id-type] | ||
* std[meta namespace] | ||
* aligned_accessor[meta class] | ||
* cpp26[meta cpp] | ||
|
||
```cpp | ||
template<class OtherElementType> | ||
constexpr operator default_accessor<OtherElementType>() const noexcept; | ||
``` | ||
* default_accessor[link ../default_accessor.md] | ||
|
||
## 概要 | ||
[`default_accessor`](../default_accessor.md)型への変換演算子 | ||
|
||
|
||
## テンプレートパラメータ制約 | ||
[`is_convertible_v`](/reference/type_traits/is_convertible.md)`<element_type(*)[], OtherElementType(*)[]>`が`true`であること | ||
|
||
|
||
## 効果 | ||
`return {};`と等価 | ||
|
||
|
||
## 例外 | ||
投げない | ||
|
||
|
||
## バージョン | ||
### 言語 | ||
- C++26 | ||
|
||
### 処理系 | ||
- [Clang](/implementation.md#clang): ?? | ||
- [GCC](/implementation.md#gcc): ?? | ||
- [ICC](/implementation.md#icc): ?? | ||
- [Visual C++](/implementation.md#visual_cpp): ?? | ||
|
||
|
||
## 参照 | ||
- [P2897R7 `aligned_accessor`: An mdspan accessor expressing pointer over-alignment](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2897r7.html) |