fork(6) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Add {
  5. double x=0, y=0;
  6. operator double () { return x+y; }
  7. };
  8.  
  9.  
  10. int main() {
  11. double z=Add{ 10,20 };
  12. cout<<z<<endl;
  13. return 0;
  14. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
30