fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <typename T, std::size_t... Sizes>
  5. class Foo {
  6. public:
  7. const std::size_t rank = (sizeof...(Sizes));
  8. const std::size_t dimensions[sizeof...(Sizes)] = {Sizes...};
  9. };
  10.  
  11. int main() {
  12.  
  13. Foo<int, 1, 2, 3> foo;
  14.  
  15. std::cout << "Rank: " << foo.rank << std::endl;
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
Rank: 3