I have a vector of pair defined as follows:
vector<pair<int, myClass *>> myVector;
The vector is sorted using the following:
sort(myVector.begin(), myVector.end());
This code is not mine and everything is working fine.
The only thing I don't get and I would like to understand is:
When I have two elements of my vector with the same int value as first, how the sorting is done? On which criteria?
I was thinking first, it's based on the value of the pointer to my object in the pair. But I can't see it.
I want to understand it because I need to reproduce this behavior (the sorting) on a demonstrator on Matlab.
As I said in the comment to my question, tt's indeed the numeric value of the pointer which is use as second sorting argument. This behavior doesn't make any sense in the program itself (once again, not my program) but also it won't be reproducible in Matlab. Anyway, thanks all for your help.