I have declared a map like this
map<long long, list<SoundInfo *> > m_soundListMap;
and I also have this function
void addSoundInfo(long long deviceId, SoundInfo * info)
I am trying to add sound info associate with the device id as the key into the map. In this function, I assumed that a key and value pair has been added to the map. So I can retrieve the list of the sound info and add incoming sound info to the back of the list.
I want to catch an exception for the case that the map doesn't have the key then I can create the key and value pair and insert into the map.
How do I catch this exception in C++?
Thanks in advance...