I have a list of D-dimensional points (where D is a constant), and I would like to sort them first based on the 1st dimension values, then by the 2nd dimesion values and so on, so if 2 points have the same values at the first x dimensions, they would be sorted based on the values of dimension x+1.
I know that if my number of dimension is final, I could use this solution: https://stackoverflow.com/a/37111840 But since I have D dimensions where D is a constant number in the code, I'm not sure how to define the sorting "key" values well.