jeudi 20 septembre 2018

How to get the longest string in a set of strings in c++

I have a set of strings

set<string> strings;

How do I get the longest string contained in the set? In python I could do the following:

print max(strings, key=len)

Is there a similar function in c++?

Aucun commentaire:

Enregistrer un commentaire