fork download
  1. #include <iostream>
  2.  
  3. class A
  4. {
  5. public:
  6. A& operator==(const A&) {
  7. return *this;
  8. }
  9.  
  10. operator bool() const {
  11. return true;
  12. }
  13. };
  14.  
  15. int main() {
  16. A x, y, z;
  17. std::cout << std::boolalpha << (x == y == z) << std::endl;
  18. }
  19.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
true