Is there a way to specify the default value std::map\'s operator[] returns when an key does not exist?
std::map
operator[]
While this does not exactly answer the question, I have circumvented the problem with code like this:
struct IntDefaultedToMinusOne { int i = -1; }; std::map mymap;