I have a C++ std::vector denoted as:
std::vector<GameObject*> vectorToSort;
Each object in vectorToSort contains a float parameter which is returned by calling "DistanceFromCamera()":
vectorToSort.at(position)->DistanceFromCamera();
I wish to sort the vector by this float parameter however std::sort does not appear to be able to do this. How can I achieve this sort?