int getCountryCode(const CodeMap& map, const std::string& country) { CodeMap::const_iterator i = map.find(country); if (i != map.end()) return i->second; else return 0; }