How do you clear or empty a map? I try searching for "Clear Map" and I
don't get anything about C++.
I have this in my Init.h
typedef std::map< long, std::string, std::less< long > > HEADERS;
HEADERS m_mapHeaders;
I have a function that does this..
m_mapHeaders[m_iHeaderCount] = strNewVal;
m_iHeaderCount += 1;
I have a function call ResetHeader(). This is to clear the map. Now I know
I can just reset the m_iHeaderCount = 0 and everything will work just as I
want it to, but the map it self still has all the data in it, even if it's
not used because other code is looking at the m_iHeaderCount.. I want to
empty this map, just to be clean. How can I do this without looping through
and clearing each element? Or is this the only way to do it?