rank calculation in c++ code example
Example: rank() in c++
// array rank example
#include <iostream>
#include <type_traits>
int main() {
std::cout << "rank:" << std::endl;
std::cout << "int: " << std::rank<int>::value << std::endl;
std::cout << "int[]: " << std::rank<int[]>::value << std::endl;
std::cout << "int[][10]: " << std::rank<int[][10]>::value << std::endl;
std::cout << "int[10][10]: " << std::rank<int[10][10]>::value << std::endl;
return 0;
}