The correct way to clear a embeded map variable [modified]
ATL / WTL / STL
2
Posts
2
Posters
0
Views
1
Watching
-
Hi ALL, I am not very sure if I am correct when i clear a embeded map variable.
map > C1;
//insert some elements into C1 here
for(iter1 = C1.begin(); iter1 = C1.end(); iter1++)
{
map.swap((*iter1).second);
}map >().swap(C1);
modified on Saturday, May 28, 2011 10:14 AM
-
Hi ALL, I am not very sure if I am correct when i clear a embeded map variable.
map > C1;
//insert some elements into C1 here
for(iter1 = C1.begin(); iter1 = C1.end(); iter1++)
{
map.swap((*iter1).second);
}map >().swap(C1);
modified on Saturday, May 28, 2011 10:14 AM
cy163@hotmail.com wrote:
I am not very sure if I am correct when i free a map variable.
Are you looking for this[^]? cheers, AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)