How can I sort this vector by comparing the pair.first which is an std::string? (without providing a static compare function, nor use
vector
pair.first
std::string
Answer to "duplicate question" of this: link: Sort a vector of pairs by first element then by second element of the pair in C++?
bool cmp(const pair&x,const pairy){ if(x.first==y.first){ return(x.second