1 | initial version |
if you got a vector<Rect>
, you can use std::sort, all you need is a compare function:
bool compare_rect(const Rect & a, const Rect &b) {
return a.x < b.x;
}
vector<Rect> rects;
sort( rects.begin(), rects.end(), compare_rect );