'Is it possible to sort the list of pair <string ,node> on c++,, based upon one of the attribute(string) of node ? How?

//THis is how list of pair has defined

list<pair<string,car> >car_details;

//node creation


struct car{
    string id;
    string date;
    string etime;
    string exit_time;
    double price;
};

car carnode{id, date, s2, s1, amount}; //id,date,s2,s1 -string , amount -double

insert is being performed like this, car_details.push_back(make_pair(id,carnode));

//Actually want to sort based upon that entrytime(etime) attribute ( which is string in the format HH:MM:SS) like ( "08:35:20")



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source