class template
<type_traits>
std::extenttemplate <class T, unsigned I = 0> struct extent;
Array dimension extent
If T is an array that has a rank greater than I, the extent is the bound (i.e., the number of elements) of the Ith dimension.
In all other cases, and in the case that I is zero and T is an array of unknown bound, the extent value is zero.
This class is derived from integral_constant.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// array rank/extent example
#include <iostream>
#include <type_traits>
int main() {
typedef int mytype[][24][60];
std::cout << "mytype array (int[][24][60]):" << std::endl;
std::cout << "rank: " << std::rank<mytype>::value << std::endl;
std::cout << "extent (0th dimension): " << std::extent<mytype,0>::value << std::endl;
std::cout << "extent (1st dimension): " << std::extent<mytype,1>::value << std::endl;
std::cout << "extent (2nd dimension): " << std::extent<mytype,2>::value << std::endl;
std::cout << "extent (3rd dimension): " << std::extent<mytype,3>::value << std::endl;
return 0;
}
mytype array (int[][24][60]): rank: 3 extent (0th dimension): 0 extent (1st dimension): 24 extent (2nd dimension): 60 extent (3rd dimension): 0
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4