#include<type_traits> // for array query functions
#include<iostream>
using
namespace
std;
int
main()
{
cout <<
"The extent of 1st dimension of 3D integer array is : "
;
cout << extent<
int
[20][10][40],0>::value << endl;
cout <<
"The extent of 2nd dimension of 3D integer array is : "
;
cout << extent<
int
[20][10][40],1>::value << endl;
cout <<
"The extent of 3rd dimension of 3D integer array is : "
;
cout << extent<
int
[20][10][40],2>::value << endl;
cout <<
"The extent of 4th dimension of 3D integer array is : "
;
cout << extent<
int
[20][10][40],3>::value << endl;
cout << endl;
cout <<
"The rank after removing 1 extent is : "
;
cout << rank<remove_extent<
int
[20][10][30]>::type>::value << endl;
cout <<
"The extent of 1st after removing 1 extent is : "
;
cout << extent<remove_extent<
int
[20][10][30]>::type>::value << endl;
cout << endl;
cout <<
"The rank after removing all extents is : "
;
cout << rank<remove_all_extents<
int
[20][10][30]>::type>::value << endl;
cout <<
"The extent of 1st after removing all extents is : "
;
cout << extent<remove_all_extents<
int
[20][10][30]>::type>::value << endl;
cout << endl;
}