fork(2) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. struct Cast
  6. {
  7. int i;
  8. operator int() { return i++; }
  9. Cast(int i):i(i){}
  10. };
  11.  
  12. struct Equl
  13. {
  14. bool operator==(int) const { return true; }
  15. };
  16.  
  17.  
  18. int main()
  19. {
  20. Cast i = 1;
  21. cout << (i==1 && i==2 && i==3 && i==4) << endl;
  22.  
  23. Equl q;
  24. cout << (q==1 && q==2 && q==3 && q==4) << endl;
  25. }
  26.  
  27.  
  28.  
Success #stdin #stdout 0s 4404KB
stdin
Standard input is empty
stdout
1
1