2.3 KiB
2.3 KiB
[meta.trans.arr]
21 Metaprogramming library [meta]
21.3 Metaprogramming and type traits [type.traits]
21.3.9 Transformations between types [meta.trans]
21.3.9.5 Array modifications [meta.trans.arr]
The templates specified in Table 60 modify array types.
Table 60 — Array modifications [tab:meta.trans.arr]
| ð Template |
Comments |
|---|---|
| ð template 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 struct remove_all_extents; |
If T is âmultidimensional array of Uâ, the resulting member typedef type denotes U, otherwise T. |
[Example 1: // the following assertions hold:static_assert(is_same_v<remove_extent_t, int>);static_assert(is_same_v<remove_extent_t<int[2]>, int>);static_assert(is_same_v<remove_extent_t<int[2][3]>, int[3]>);static_assert(is_same_v<remove_extent_t<int[][3]>, int[3]>); â end example]
[Example 2: // the following assertions hold:static_assert(is_same_v<remove_all_extents_t, int>);static_assert(is_same_v<remove_all_extents_t<int[2]>, int>);static_assert(is_same_v<remove_all_extents_t<int[2][3]>, int>);static_assert(is_same_v<remove_all_extents_t<int[][3]>, int>); â end example]