fork download
  1. namespace N1 {
  2. class A {};
  3. void foo (A *p) {}
  4. }
  5. namespace N2 {
  6. void foo (N1::A &p) {}
  7. }
  8.  
  9. int main () {
  10. N1::A xa;
  11. foo(&xa);
  12. foo(xa);
  13. }
  14.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:12:9: error: cannot convert ‘N1::A’ to ‘N1::A*’ for argument ‘1’ to ‘void N1::foo(N1::A*)’
stdout
Standard output is empty