, map ( ). operator[] , , - .
:
class unititialized_access : public std::runtime_error
{
};
map<Key, Value>::operator[]:
if (<key doesn't exist>)
throw unititialized_error("blah blah");
:
try
{
m["foo"] = 42;
}
catch (const unitialized_error& e)
{
}
user2033018