21
Metaprogramming library
[meta]
21.3
Metaprogramming and type traits
[type.traits]
21.3.8
Transformations between types
[meta.trans]
21.3.8.5
Array modifications
[meta.trans.arr]
1
#
The templates specified in Table
53
modify array types
.
Table
53
: Array modifications
[tab:meta.trans.arr]
đź”—
Template
Comments
đź”—
template
<
class
T
>
struct
remove_
extent;
If
T
is a type “array of
U
”, the member typedef
type
denotes
U
, otherwise
T
.
[
Note
1
:
For multidimensional arrays, only the first array dimension is removed
.
For a type “array of
const
U
”, the resulting type is
const
U
.
—
end note
]
đź”—
template
<
class
T
>
struct
remove_
all_
extents;
If
T
is “multidimensional array of
U
”, the resulting member typedef
type
denotes
U
, otherwise
T
.
2
#
[
Example
1
:
// the following assertions hold:
assert
(
(
is_same_v
<
remove_extent_t
<
int
>
,
int
>
)
)
; assert
(
(
is_same_v
<
remove_extent_t
<
int
[
2
]
>
,
int
>
)
)
; assert
(
(
is_same_v
<
remove_extent_t
<
int
[
2
]
[
3
]
>
,
int
[
3
]
>
)
)
; assert
(
(
is_same_v
<
remove_extent_t
<
int
[
]
[
3
]
>
,
int
[
3
]
>
)
)
;
—
end example
]
3
#
[
Example
2
:
// the following assertions hold:
assert
(
(
is_same_v
<
remove_all_extents_t
<
int
>
,
int
>
)
)
; assert
(
(
is_same_v
<
remove_all_extents_t
<
int
[
2
]
>
,
int
>
)
)
; assert
(
(
is_same_v
<
remove_all_extents_t
<
int
[
2
]
[
3
]
>
,
int
>
)
)
; assert
(
(
is_same_v
<
remove_all_extents_t
<
int
[
]
[
3
]
>
,
int
>
)
)
;
—
end example
]