I have a standard vector contains, for example, the following elements
[-6, -7, 1, 2]
I need to map these elements to the range from 1 to 4. i.e I need the vector to be like this
[2, 1, 3, 4]
Note that: the smallest value in the first vector (-7) was mapped to the smallest value in the second vector (1). How can I achieve that with STL?