// Single line to get the pair: std::pair<key_t, value_t> pair = *std::next(map.begin(), at); // To get the iterator: auto itr = std::next(map.begin(), at);