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).
8 [section:extent extent]
9 template <class T, std::size_t N = 0>
10 struct extent : public __integral_constant<std::size_t, EXTENT(T,N)> {};
12 __inherit Class template extent inherits from `__integral_constant<std::size_t, EXTENT(T,N)>`,
13 where `EXTENT(T,N)` is the number of elements in the N'th array dimension of type `T`.
15 If `T` is not a (built-in) array type, or if `N > __rank<T>::value`, or if the N'th array bound
16 is incomplete, then `EXTENT(T,N)` is zero.
18 __header ` #include <boost/type_traits/extent.hpp>` or ` #include <boost/type_traits.hpp>`
22 [:`extent<int[1]>` inherits from `__integral_constant<std::size_t, 1>`.]
24 [:`extent<double[2][3][4], 0>::type` is the type `__integral_constant<std::size_t, 2>`.]
26 [:`extent<double[2][3][4], 1>::type` is the type `__integral_constant<std::size_t, 3>`.]
28 [:`extent<double[2][3][4], 2>::type` is the type `__integral_constant<std::size_t, 4>`.]
30 [:`extent<int[4]>::value` is an integral constant
31 expression that evaluates to /4/.]
33 [:`extent<int[][2]>::value` is an integral constant
34 expression that evaluates to /0/.]
36 [:`extent<int[][2], 1>::value` is an integral constant
37 expression that evaluates to /2/.]
39 [:`extent<int*>::value` is an integral constant
40 expression that evaluates to /0/.]
42 [:`extent<boost::array<int, 3> >::value` is an integral constant
43 expression that evaluates to /0/: `boost::array` is a class type and [*not an array type]!]
45 [:`extent<T>::value_type` is the type `std::size_t`.]