What is the correct less operator for simple class with two int members?

Posted by Frank on Stack Overflow See other posts from Stack Overflow or by Frank
Published on 2010-04-26T02:11:25Z Indexed on 2010/04/26 2:13 UTC
Read the original article Hit count: 309

Filed under:
|

What is the correct operator< for the following class?

struct Foo {
  int x;
  int y;
  friend bool operator<(const Foo&, const Foo&);
};

Thanks!

© Stack Overflow or respective owner

Related posts about c++

Related posts about operator-overloading