std::mdspan<T,Extents,LayoutPolicy,AccessorPolicy>:: mdspan
|
constexpr
mdspan
(
)
;
|
(1) | (C++23以降) |
|
template
<
class
...
OtherIndexTypes
>
constexpr explicit mdspan ( data_handle_type p, OtherIndexTypes... exts ) ; |
(2) | (C++23以降) |
|
template
<
class
OtherIndexType,
std::
size_t
N
>
constexpr
explicit
(
N
!
=
rank_dynamic
(
)
)
|
(3) | (C++23以降) |
|
template
<
class
OtherIndexType,
std::
size_t
N
>
constexpr
explicit
(
N
!
=
rank_dynamic
(
)
)
|
(4) | (C++23以降) |
|
constexpr
mdspan
(
data_handle_type p,
const
extents_type
&
ext
)
;
|
(5) | (C++23以降) |
|
constexpr
mdspan
(
data_handle_type p,
const
mapping_type
&
m
)
;
|
(6) | (C++23以降) |
|
constexpr
mdspan
(
data_handle_type p,
const
mapping_type
&
m,
const accessor_type & a ) ; |
(7) | (C++23以降) |
|
template
<
class
OtherElementType,
class
OtherExtents,
class
OtherLayoutPolicy,
class
OtherAccessor
>
|
(8) | (C++23以降) |
|
constexpr
mdspan
(
const
mdspan
&
rhs
)
=
default
;
|
(9) | (C++23以降) |
|
constexpr
mdspan
(
mdspan
&&
rhs
)
=
default
;
|
(10) | (C++23以降) |
mdspan
を構築します。オプションでユーザー提供のデータハンドル
p
、レイアウトマッピング
m
、およびアクセサ
a
を使用します。エクステント
exts
または
ext
が指定された場合、それらは
extents_type
に変換され、レイアウトマッピングの初期化に使用されます。
目次 |
、
、
パラメータ
| p | - | 基盤データへのハンドル |
| m | - | レイアウトマッピング |
| a | - | アクセサ |
| ext | - |
std::extents
オブジェクト
|
| exts | - | 多次元エクステントを表す |
| other | - | 変換元の別のmdspan |
| rhs | - | コピーまたはムーブ元の別のmdspan |
効果
以下の表にリストされているデータメンバについて:
- 対応する初期化子が空の場合、データメンバは value-initialized されます。
- 対応する初期化子が空でない場合、データメンバはその初期化子で direct-non-list-initialized されます。
| オーバーロード | 初期化対象... | ||
|---|---|---|---|
ptr_
|
map_
|
acc_
|
|
| ( 1 ) | (空) | ||
| ( 2 ) | std :: move ( p ) |
extents_type
( static_cast < index_type > ( std :: move ( exts ) ) ... ) |
(空) |
| ( 3 ) | extents_type ( exts ) | ||
| ( 4 ) | |||
| ( 5 ) | ext | ||
| ( 6 ) | m | ||
| ( 7 ) | a | ||
| ( 8 ) |
other.
ptr_
|
other.
map_
|
other.
acc_
|
制約条件と補足情報
- rank_dynamic ( ) > 0
- std:: is_default_constructible_v < data_handle_type >
- std:: is_default_constructible_v < mapping_type >
- std:: is_default_constructible_v < accessor_type >
map_
および
acc_
のこのコンストラクタ呼び出し後の値に対して、
[
0
,
map_
.
required_span_size
(
)
)
が
ptr_
および
acc_
の
accessible range
でない場合、動作は未定義です。
- ( std:: is_convertible_v < OtherIndexTypes, index_type > && ... )
- ( std:: is_nothrow_constructible < index_type, OtherIndexTypes > && ... )
- sizeof... ( OtherIndexTypes ) == rank ( ) || sizeof... ( OtherIndexTypes ) == rank_dynamic ( )
- std:: is_constructible_v < mapping_type, extents_type >
- std:: is_default_constructible_v < accessor_type >
[
0
,
map_
.
required_span_size
(
)
)
is not an accessible range of
p
and
acc_
for the values of
map_
and
acc_
after the invocation of these constructors, the behavior is undefined.
[
0
,
map_
.
required_span_size
(
)
)
が
p
および
acc_
のアクセス可能な範囲ではなく、これらのコンストラクタの呼び出し後の
map_
および
acc_
の値に対して、動作は未定義です。
- std:: is_convertible_v < const OtherIndexType & , index_type >
- std:: is_nothrow_constructible_v < index_type, const OtherIndexType & >
- N == rank ( ) || N == rank_dynamic ( )
- std:: is_constructible_v < mapping_type, extents_type >
- std:: is_default_constructible_v < accessor_type >
[
0
,
map_
.
required_span_size
(
)
)
が
p
および
acc_
に対するアクセス可能な範囲ではなく、かつこれらコンストラクタの呼び出し後の
map_
および
acc_
の値の場合、動作は未定義です。
- std:: is_constructible_v < mapping_type, const extents_type & >
- std:: is_default_constructible_v < accessor_type >
[
0
,
map_
.
required_span_size
(
)
)
が
p
および
acc_
に対してアクセス可能な範囲ではなく、かつこれらコンストラクタの呼び出し後の
map_
および
acc_
の値である場合、動作は未定義です。
[
0
,
m.
required_span_size
(
)
)
が
p
および
acc_
のアクセス可能な範囲でない場合、このコンストラクタの呼び出し後の
acc_
の値に対する動作は未定義です。
[
0
,
m.
required_span_size
(
)
)
が
p
と
a
のアクセス可能な範囲でない場合、動作は未定義です。
mapping_type >
|| ! std:: is_convertible_v < const OtherAccessor & , accessor_type > 。
-
std::
is_constructible_v
< mapping_type, const OtherLayoutPolicy :: template mapping < OtherExtents > & > - std:: is_default_constructible_v < accessor_type >
- std:: is_constructible_v < data_handle_type, const OtherAccessor :: data_handle_type & >
- std:: is_constructible_v < extents_type, OtherExtents >
[
0
,
map_
.
required_span_size
(
)
)
が
ptr_
および
acc_
のアクセス可能な範囲ではない場合(このコンストラクタ呼び出し後の
ptr_
、
map_
および
acc_
の値に対して)、動作は未定義です。
|
|
(C++26まで) |
|
|
(C++26から) |
例
|
このセクションは不完全です
理由: 例がありません |
参考文献
- C++23標準 (ISO/IEC 14882:2024):
-
- 24.7.3.6.2 コンストラクタ [mdspan.mdspan.cons]
関連項目
| このセクションは不完全です |