Template and std::sort : I have this:

    template <typename T1, typename T2>
    
    struct coords {
    
    		T1 x;
    		T2 y;
    	
    };
    
    std::vector<coords<int, int>>	pixels;

and i want to sort each value pair of coords seperately using std::sort or any other function that can handle it. As a workaround I thought of copying each value of the pair in seperate vectors, and then use std::sort on it and finally copy the result back into coords.

Just wanted to know if there is a more efficient way.