| description | Learn more about: extent Class | ||
|---|---|---|---|
| title | extent Class | ||
| ms.date | 11/04/2016 | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | 6d16263d-90b2-4330-9ec7-b59ed898792d |
Gets an array dimension.
template <class Ty, unsigned I = 0>
struct extent;Ty
The type to query.
I
The array bound to query.
If Ty is an array type that has at least I dimensions, the type query holds the number of elements in the dimension specified by I. If Ty is not an array type or its rank is less than I, or if I is zero and Ty is of type "array of unknown bound of U", the type query holds the value 0.
// std__type_traits__extent.cpp
// compile with: /EHsc
#include <type_traits>
#include <iostream>
int main()
{
std::cout << "extent 0 == "
<< std::extent<int[5][10]>::value << std::endl;
std::cout << "extent 1 == "
<< std::extent<int[5][10], 1>::value << std::endl;
return (0);
}extent 0 == 5
extent 1 == 10
Header: <type_traits>
Namespace: std