std::map add const to its key; this should prevent spoiling the order. Your couple should be:
std::pair<const int, int>
As usually suggested, use value_type to always get the correct type. Verbosity is facilitated by typedef:
typedef std::map<int, int> int_map; int_map::value_type::second
source share