I'm trying to get the element with max value from std::map,
int main() {
map<int, int> m;
m[1] = 100;
m[2] = -1;
auto x = std::max_element(m.begin(), m.end(), m.value_comp());
cout << x->first << " : " << x->second << endl;
}
why it prints the second element 2 : -1
?