fork download
  1. #include <iostream>
  2. #include <utility>
  3. #include <tuple>
  4. using namespace std;
  5.  
  6. class Foo{
  7. int x, y;
  8. public:
  9. Foo(int x, int y):x(x),y(y){}
  10. bool operator<(const Foo& other)const{
  11. return tie(x,y) < tie(other.x, other.y);
  12. }
  13. };
  14.  
  15. int main() {
  16. // your code goes here
  17. Foo a(1,2), b(2,4);
  18. cout << (a < b);
  19. return 0;
  20. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
1