Answers for "rank() in c++"

C++
1

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;
}
Posted by: Guest on January-03-2021

Browse Popular Code Answers by Language