I have a very simple class that is stored inside STL Vector. I try to sort this vector, but I get cryptic STL errors. Can anyone help?
class Point {
public:
Point() : x(0), y(0) {}
Point( float x0, float y0 ) : x(x0), y(y0) {}
float x;
float y;
};
bool operator< (const Point &p1,const Point &p2)
{
return p1.x < p2.x || (p1.x==p2.x && p1.y< p2.y);
}
Again, this Point class is stored in a vector and sorted:
std::vector<Point> tmp=N->points;
std::sort(tmp.begin(),tmp.end());
Errors:
http://ideone.com/WIv0u
Can someone point me in the right direction? Thank!
source
share