I have an std::vector of the size 10 and each entry is initially -1. This vector represents a leaderboard for my game (high scores), and -1 just means th
std::vector
You can provide lambda as parameter for sort:
std::sort(myVector.begin(), myVector.end(),[]( int i1, int i2 ) { if( i1 == -1 ) return false; if( i2 == -1 ) return true; return i1 < i2; } );
here is the demo (copied from Kerrek)
but it is not clear how you realize where is which score after sort.