I am trying to sort vector of points (pairs of integers) by the polar angle in counter-clockwise order around the first entry of the vector. I get wrong output, but can't find the problem in the code. I will appreciate it if you point out what I'm doing wrong. Here is my code: https://pastebin.com/mn6jZgyF
The comparison function has to be a strict weak ordering. Yours isn't. You keep the point at index 0 in the array you are sorting, and according to your comparison function this point is equivalent ("equal") to any other point because the cross product is always zero.
Use this compare: