Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Compare
- {
- public:
- Compare( bool theVert, bool theDesc )
- : vert( theVert ),
- desc( theDesc )
- {
- }
- bool operator () ( Object* a, Object* b )
- {
- float n1 = a->x;
- float n2 = b->x;
- if ( theVert )
- {
- n1 = a->y;
- n2 = b->y;
- }
- return ( desc ) ? ( n1 < n2 ) : ( n2 >= n1 );
- }
- private:
- const bool vert;
- const bool desc;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement