fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <list>
  4.  
  5. using namespace std;
  6.  
  7. template<template<class, class> class Container, class T>
  8. void print(const Container<T, allocator<T> >& container)
  9. {
  10. for (const auto& item : container)
  11. cout << item << endl;
  12. }
  13.  
  14. int main()
  15. {
  16. vector<int> v{ 1, 2, 3 };
  17. print(v);
  18. return 0;
  19. }
Success #stdin #stdout 0s 2984KB
stdin
stdout
1
2
3