I have a std::set, what\'s the proper way to find the largest int in this set?
std::set
What comparator are you using?
For the default this will work:
if(!myset.empty()) *myset.rbegin(); else //the set is empty
This will also be constant time instead of linear like the max_element solution.