fork download
  1. #include <iostream>
  2.  
  3. typedef std::pair<int, int> between;
  4. inline bool operator== (const between& lhs, const int& rhs)
  5. {
  6. return lhs.first < rhs && lhs.second > rhs;
  7. }
  8. inline bool operator== (const int& lhs, const between& rhs)
  9. {
  10. return rhs.first < lhs && rhs.second > lhs;
  11. }
  12.  
  13. int main()
  14. {
  15. int x = 5;
  16. if ( x == between(4,6) )
  17. {
  18. return 1;
  19. }
  20. return 0;
  21. }
Runtime error #stdin #stdout 0s 3092KB
stdin
Standard input is empty
stdout
Standard output is empty