fork download
  1. #include <iostream>
  2. #include <algorithm>
  3.  
  4. struct Foo{};
  5.  
  6. namespace std
  7. {
  8. template<typename T>
  9. void swap(Foo& f1, T& f2)
  10. {
  11. std::cout << "My swap: " << f2 << std::endl;
  12. }
  13. }
  14.  
  15. int main() {
  16. // your code goes here
  17. Foo foo1;
  18. int i = 6;
  19. std::swap(foo1,i);
  20. return 0;
  21. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
My swap: 6