Tho*_*eod 4 c++ destructor stl map
例如,以下是否泄漏?
Foo ( )
{
   std:map<std:string, int> myMap;
   myMap[std::string("Bar")] = 2983;
}
我相信它不会泄漏,但在这一点上找不到具体的文档。
是的,映射析构函数map::~map()将为它管理的每个键和值调用析构函数并释放内存。
§ 23.2.1 表 96 — 集装箱要求(续)
(&a)->X() void 
the destructor is applied to every element of a; all the memory is deallocated.