fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. template <typename T>
  5. void printVar(const T& v)
  6. {
  7. std::cout << v;
  8. }
  9.  
  10. template <typename T>
  11. void printVar(const std::vector<T>& v)
  12. {
  13. for (auto i = v.cbegin(); i != v.cend(); ++i)
  14. {
  15. printVar(*i);
  16. }
  17. }
  18.  
  19. int main()
  20. {
  21. std::vector<std::vector<std::vector<int>>> v;
  22. v.push_back(std::vector<std::vector<int>>(2, std::vector<int>(5, 3)));
  23. printVar(v);
  24. }
Success #stdin #stdout 0s 3020KB
stdin
Standard input is empty
stdout
3333333333