I have a std::set<int>, what's the proper way to find the largest int in this set?
I have a std::set<int>, what's the proper way to find the largest int in this set?
if(!myset.empty())
*myset.rend();
else
//the set is empty
In an ordered integer set, the last element is the largest one.