fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. template<typename T>
  5. void print( const T &t )
  6. {
  7. std::cout << t;
  8. }
  9.  
  10. template<typename T>
  11. void print( const std::vector<T> &v )
  12. {
  13. std::cout << '[';
  14. for( auto it = v.begin(); it != v.end(); ++it ) {
  15. if( it != v.begin() ) std::cout << ',';
  16. print( *it );
  17. }
  18. std::cout << ']';
  19. }
  20.  
  21.  
  22. int main() {
  23. std::vector<std::vector<int>> vv = { {1,2,3}, {4,5} };
  24. print(vv);
  25. return 0;
  26. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
[[1,2,3],[4,5]]