I have such array:
long my_array_left[n][2];
I wrote comparator function for it, which takes array of two elements and sort by first element of array:
struct sort_left {
bool operator()(const long &left[2], const long &right[2]) {
return left[0] < right[0];
}
}
Then I use library function std::sort
for sorting my_array_left[n][2]
sort(begin(my_array_left), end(my_array_left), sort_left());
But I have an error:
parameter type mismatch: Incompatible pointer types 'long **' and 'long[2]*'
.
How can I overcome it?