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 >
[
0
,
map_
.
required_span_size
(
)
)
가 이 생성자 호출 후의
map_
와
acc_
값들에 대해
ptr_
와
acc_
의
접근 가능 범위
가 아니라면, 동작은 정의되지 않습니다.
- ( 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
(
)
)
가
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_
,
map_
및
acc_
값에 대해
ptr_
와
acc_
의 접근 가능한 범위가 아니라면, 동작은 정의되지 않습니다.
|
만약
static_extent
(
r
)
==
std::
dynamic_extent
|
(C++26 이전) |
|
만약
static_extent
(
r
)
==
std::
dynamic_extent
|
(C++26 이후) |
예제
|
이 섹션은 불완전합니다
이유: 예제 없음 |
참조문헌
- C++23 표준 (ISO/IEC 14882:2024):
-
- 24.7.3.6.2 생성자 [mdspan.mdspan.cons]
참고 항목
| 이 섹션은 불완전합니다 |