20
General utilities library
[utilities]
20.15
Metaprogramming and type traits
[meta]
20.15.8
Transformations between types
[meta.trans]
20.15.8.5
Array modifications
[meta.trans.arr]
Table
55
: Array modifications
[tab:meta.trans.arr]
๐
Template
Comments
๐
template
<
class
T
>
struct
remove_extent;
If
T
names a type โarray of
U
โ, the member typedef
type
shall be
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 โmulti-dimensional array of
U
โ, the resulting member typedef
type
is
U
, otherwise
T
.
1
#
[
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
]
2
#
[
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
]