M
Milind
Hello,
I have a std::map which looks like
typedef map<T1, map<T2, T3> > myMap;
as a part of my code i delete a pair from the myMap if the nested map
is empty. for example a sequence in my code looks like:
myMap xyz;
myMap::iterator i = xyz.find(someValueofT1);
i->second.erase(T2);
if(i->second.empty()) {
xyz.erase(i);
}
T1, T2 and T3 are all reference counting pointers (smart pointers)
which will delete themselves after i have no references for them.
Now, the when i call erase, delete is not called for any of the
members, how do i ensure that the memeory allocated for the nested map
is cleaned? Is is cleaned in the first place??
Any pointers, links??
Am I missing someting too obvious??
~M
I have a std::map which looks like
typedef map<T1, map<T2, T3> > myMap;
as a part of my code i delete a pair from the myMap if the nested map
is empty. for example a sequence in my code looks like:
myMap xyz;
myMap::iterator i = xyz.find(someValueofT1);
i->second.erase(T2);
if(i->second.empty()) {
xyz.erase(i);
}
T1, T2 and T3 are all reference counting pointers (smart pointers)
which will delete themselves after i have no references for them.
Now, the when i call erase, delete is not called for any of the
members, how do i ensure that the memeory allocated for the nested map
is cleaned? Is is cleaned in the first place??
Any pointers, links??
Am I missing someting too obvious??
~M