## playerstage-developers

 [Playerstage-developers] stage patch, std_point_int_t '<' not consistent From: Jeff Donner - 2009-10-23 11:43:30 Attachments: pt-lt-fix-diff.txt ```In stage.hh, class std_point_int_t { ... bool operator<( const stg_point_int_t& other ) const { return ((x < other.x) || (y < other.y) ); } ... This isn't consistent - for 2 points A, B it works when A's coordinates are both larger than B's or vice-versa, but when each has one coordinate bigger than the corresponding other's, A can be < B and simultaneously B < A. Eg, A is (1, 5), B is (5, 1): is A < B ? A.x < B.x, so, yes. is B < A ? B.x is not < A.x, but it's an 'or' so we get another chance, B.y < A.y so, B < A, also. The patch uses the x coordinate, unless A.x == B.x, when it uses y. ```
 Re: [Playerstage-developers] stage patch, std_point_int_t '<' not consistent From: Richard Vaughan - 2009-10-27 06:37:32 ```Thanks Jeff. Well spotted. Applied in trunk. Your patches are always welcome! Richard/ On Fri, Oct 23, 2009 at 4:43 AM, Jeff Donner wrote: > In stage.hh, > > class std_point_int_t > { > ... >         bool operator<( const stg_point_int_t& other ) const >         { return ((x < other.x) || (y < other.y) ); } > ... > > This isn't consistent - for 2 points A, B it works when > A's coordinates are both larger than B's or vice-versa, > but when each has one coordinate bigger than the corresponding other's, > A can be < B  and simultaneously   B < A. > > Eg, A is (1, 5), B is (5, 1): > > is  A < B ? >         A.x < B.x, so, yes. > > is  B < A ? >         B.x is not < A.x,  but it's an 'or' so we get another chance, >         B.y < A.y    so, B < A, also. > > The patch uses the x coordinate, unless A.x == B.x, when it uses y. > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Playerstage-developers mailing list > Playerstage-developers@... > https://lists.sourceforge.net/lists/listinfo/playerstage-developers > > -- Richard Vaughan Autonomy Lab / Computing Science / Simon Fraser University ```