typedef std::pair<std::string, std::string> FooPair;
typedef std::map<FooPair, std::string> FooMapper;
FooMapper mapper;
for(FooMapper::const_iterator i=mapper.begin(); i != mapper.end(); ++i) {
std::cout << i->first.first << "," << i->first.second << ": " << i->second;
}
Is it possible to change i->first.first into something that makes more sense to the programmer, a way to alias .first
to a meaningful name like say i->first.countrycode
while still taking advantage of the std::pair
.