Just a quick question if you say:
using namespace std;
map< int, vector< string > > map1;
or maybe even:
map< int, map< int, vector< string > > > map2;
and you get the right idea:
map< int, map< int, map< int, vector< string > > > > map3;
if i just:
map1.clear();
map2.clear();
map3.clear();
Is it safe that it empties everything on the map and its embedded maps, vectors, lists, etc.?
Note: I know if you use pointers, you need to manually go through and delete, or if the map is out of scope, it should be okay too. I am particularly interested in this case when it is in scope and on the stack.
source
share