I would like to see the most elegant STL like extension to the partition algorithm in the STL:
given a vector of ints, partition the vector so that the positive integers appear
to the front of the negative integers
AND
return a map<int, int> where map[i]=j means that integer at index i is now at j.
Obviously the first part (without the second requirement) is something like
partititon(vec.begin(), vec.end(), IsEven)
I can't see a way to do this without actually reimplementing partition and building the map along the way.