There can be an alternate approach to achieve two values per key, especially for the cases when most of the map elements have two values per key. By pairing two values for a key, as mentioned in this link:
std::map > myMap2
use it in the function as:
#include
#include