fork download
  1. struct A {
  2. operator int();
  3. operator char();// const;
  4. } a;
  5. struct B {
  6. B(int);
  7. B(char);
  8. };
  9. int main() {
  10. B b(a);
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:10:10: error: call of overloaded 'B(A&)' is ambiguous
prog.cpp:7:5: note: candidates are: B::B(char)
prog.cpp:6:5: note:                 B::B(int)
stdout
Standard output is empty