fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. namespace foo {
  5. namespace bar {
  6. struct X {};
  7. }
  8. void magic(bar::X const & x) { cout << "foo magic" << endl; }
  9. }
  10.  
  11. template <typename T>
  12. void magic(T const & t) { cout << "template magic" << endl; }
  13.  
  14. void test1(){
  15. foo::bar::X x;
  16. magic(x);
  17. }
  18.  
  19. namespace foo {
  20. inline namespace bar{}
  21. }
  22.  
  23. void test2(){
  24. foo::bar::X x;
  25. magic(x);
  26. }
  27.  
  28. int main() {
  29. test1();
  30. test2();
  31. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
template magic
foo magic