fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. template<typename T>
  6. T create_vec()
  7. {
  8. return T();
  9. }
  10.  
  11.  
  12. template<typename T, class SizeT, class ...SizeTs>
  13. auto create_vec(SizeT sz, SizeTs... sizes)
  14. {
  15. return vector<decltype(create_vec<T>(sizes...))>(sz, create_vec<T>(sizes...));
  16. }
  17.  
  18.  
  19. int main()
  20. {
  21. int n = 10, m = 10;
  22. auto matrix = create_vec<int>(n, m);
  23. }
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty