Imagine class with string value.
class Test {
public:
string name;
};
Is is stored in vector
vector<Test> d;
I would like to use sort() function to sort objects in vector alphabeticaly by its name value. I know that sort() function has third parameter some kind of sorting function but i dont know how to write this function.
sort(d.begin(),d.end(),comp());
comp () { ? }