fork download
  1. #include <iostream>
  2.  
  3. struct Foo {
  4. friend void foo (int x) { std::cout << x << '\n'; }
  5. operator int () const { return 1234; }
  6. };
  7.  
  8. int main() {
  9. foo(Foo()); // This compiles fine
  10. return 0;
  11. }
  12.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
1234