Instead of writing town->first I would like to write town->name. Inline named accessors (Renaming first and second of a map iterator and Name
I guess elaborating on
struct City : public std::pair {
string& name() { return first; }
const string& name() const { return first; }
int& zip() { return second; }
int zip() const { return second; }
};
is the closest you get to what youre looking for, althrough struct City { string name; int zipcode; } seems perfectly fine.