blob: dbcfee9dc390b5f4b2070dd20cd9b586dbd3b9c9 [file] [log] [blame]
Brian Silverman4a2409e2018-08-04 23:24:02 -07001[/
2 Copyright 2007 John Maddock.
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at
5 http://www.boost.org/LICENSE_1_0.txt).
6]
7
8[section:remove_extent remove_extent]
9
10 template <class T>
11 struct remove_extent
12 {
13 typedef __below type;
14 };
15
16 template <class T> using remove_extent_t = typename remove_extent<T>::type; // C++11 and above
17
18__type If `T` is an array type, then removes the topmost array bound,
19otherwise leaves `T` unchanged.
20
21__std_ref 8.3.4.
22
23[all_compilers]
24
25__header ` #include <boost/type_traits/remove_extent.hpp>` or ` #include <boost/type_traits.hpp>`
26
27[table Examples
28
29[ [Expression] [Result Type]]
30
31[[`remove_extent<int>::type`][`int`]]
32
33[[`remove_extent<int const[2]>::type`] [`int const`]]
34
35[[`remove_extent<int[2][4]>::type`] [`int[4]`]]
36
37[[`remove_extent<int[][2]>::type`] [`int[2]`]]
38
39[[`remove_extent<int const*>::type`] [`int const*`]]
40
41]
42
43[endsect]
44