Hi,
I'd like to create std::set<std::pair<double, cv::Point>>.
My requirements:
1) Sort ordering: first value (lhs.first < rhs.first).
2) Elements are treats as equal where first and second value of the pair are equal (lhs.first == rhs.first && lhs.second == rhs.second).
Not equal, equivalent.
Elements a and b are equivalent if a < b == false and b < a == false.
Set by definition disallows equivalent elements from being stored.
Just ask yourself: which one of those two pairs should be first? And how your program will know this.
You might consider adding second part of pair to be used in comparison (like pair does by default) or use multiset instead
Is it possible to write proper comparator for this task?
Yes. Firstly you need to define how two points are going to be ordered (in other words in which situations one point is less than other) and think about possible collisions.
Simpliest way is to threat pont as pair of coords: