map::operator[]
creates entry if key is missing and returns reference to default-constructed entry value. So you can write:
map m;
string& s = m[42]; // no need for map::find()
if (s.empty()) { // assuming we never store empty values in m
s.assign(...);
}
cout << s;
I'm amazed at how many C++ programmers don't know this.