fork(1) download
  1. #include <set>
  2. #include <vector>
  3. #include <iostream>
  4.  
  5. template<typename C>
  6. void foo(C const& c)
  7. {
  8. std::cout << "{ ";
  9. for (auto x : c)
  10. {
  11. std::cout << x << " ";
  12. }
  13. std::cout << "}";
  14. }
  15.  
  16. int main()
  17. {
  18. std::vector<int> v = {1, 2, 3};
  19. foo(v);
  20.  
  21. std::cout << std::endl;
  22.  
  23. std::set<std::string> s = {"Hello,", "Generic", "World!"};
  24. foo(s);
  25. }
Success #stdin #stdout 0s 2988KB
stdin
Standard input is empty
stdout
{ 1 2 3 }
{ Generic Hello, World! }