fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct S
  5. {
  6. S( int = 0 ) {}
  7. // bool operator== (const S& rhs) { return true; }
  8. };
  9.  
  10. bool operator== (const S& lhs, const S& rhs) { return true; }
  11.  
  12.  
  13. int main() {
  14.  
  15. S s1, s2;
  16.  
  17. cout << boolalpha << (s1==s2) << endl;
  18.  
  19. cout << boolalpha << (1==s2) << endl;
  20.  
  21. cout << boolalpha << (s1==2) << endl;
  22.  
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
true
true
true