fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. struct complex
  6. {
  7. complex (double re = 0., double im = 0.) : re(re), im(im) {}
  8.  
  9. complex operator+=(const complex &c) { re += c.re; im += c.im; return *this; }
  10.  
  11. double re,im;
  12. };
  13.  
  14. complex operator+(complex lhs, const complex &c) { return lhs += c; }
  15.  
  16. int main(void)
  17. {
  18. 1 + complex(0,1);
  19. }
  20.  
  21.  
  22.  
Success #stdin #stdout 0s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty