fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. struct Foo {
  6. operator int() {
  7. cout << "operator int" << endl;
  8. return 0;
  9. }
  10.  
  11. operator float() {
  12. cout << "operator float" << endl;
  13. return 0;
  14. }
  15. };
  16.  
  17. int main() {
  18. Foo();
  19. Foo();
  20. }
  21.  
Success #stdin #stdout 0s 3136KB
stdin
Standard input is empty
stdout
Standard output is empty