fork download
  1. #include <iostream>
  2.  
  3. class alloc
  4. {
  5.  
  6. };
  7.  
  8. template <typename T, typename Alloc = alloc>
  9. class vector
  10. {
  11. public:
  12. void swap(const vector<T,Alloc> &v) const { std::cout << "swap()" << std::endl; }
  13. };
  14.  
  15.  
  16. template <typename T, typename Alloc>
  17. void swap(const vector<T,Alloc> &v1,const vector<T,Alloc> &v2)
  18. {
  19. v1.swap(v2);
  20. }
  21.  
  22. int main()
  23. {
  24. vector<int> x;
  25. vector<int> y;
  26.  
  27. swap(x,y);
  28.  
  29. return 0;
  30. }
  31.  
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
swap()