vector内存元素排序方式: #include <opencv2/opencv.hpp>#include <iostream>#pragma comment(lib,"opencv_world341.lib")using namespace cv;using namespace std;int main(){vector<Point2f> pts_v{ Point2f(100,200),Point2f(300,150),Point2f(200,400) };sort(pts_v.begin(), pts_v.end(), jzdst(Point2f pts1, Point2f pts2) {return pts1.x < pts2.x; });cout << pts_v << endl;return 0;}//vector<Rect> temp;std::sort(temp.begin(), temp.end(), jzdst(Rect& rect1, Rect& rect2) { return rect1.x < rect2.x; } );