fork download
  1. #include <iostream>
  2.  
  3. namespace a
  4. {
  5. struct Test
  6. {
  7. };
  8. }
  9.  
  10. namespace b
  11. {
  12. struct Test
  13. {
  14. };
  15. void f(Test &)
  16. {
  17. std::cout << "b::f(b::Test)" << std::endl;
  18. }
  19. void f(a::Test &, Test &)
  20. {
  21. std::cout << "b::f(a::Test, b::Test)" << std::endl;
  22. }
  23. }
  24.  
  25. namespace a
  26. {
  27. void f(Test &)
  28. {
  29. std::cout << "a::f(a::Test)" << std::endl;
  30. }
  31. void f(Test &, b::Test &)
  32. {
  33. std::cout << "a::f(a::Test, b::Test)" << std::endl;
  34. }
  35. }
  36.  
  37. int main()
  38. {
  39. a::Test t1;
  40. b::Test t2;
  41.  
  42. f(t1);
  43. f(t2);
  44. //f(t1, t2); // ideone.com/vC1xl9
  45. }
  46.  
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
a::f(a::Test)
b::f(b::Test)