Hi All,
I'm having a problem with stl map. Initially I fill the map with data like so.
//loop
pair< int, int > xy (x,y);
currentMap.insert( make_pair(xy), value); //map< pair<int, int>, bool>
prevMap.insert( make_pair(xy), value);
// End Loop
Then I delete an element according to some rules like so.
currentMap.erase( make_pair(xy) );
I later do a swap of the two map objects.
prevMap = currentMap;
After the swap all of the elements are assigned to true. If I search for element xy... *edit - i got a ahead of myself. Sorry.
i = currentMap.find( make_pair(xy) );
return i->second; // Always true after swap.
truth will always evaluate to true. Will initializing a map set the bool value to true? Can I initialise with all bools at false.
Thanks.