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