阅读背景:

std :: vector.clear()是否在每个元素上删除(空闲内存)?

来源:互联网 

Consider this code:

考虑以下代码:

#include <vector>

void Example()
{
    std::vector<TCHAR*> list;
    TCHAR* pLine = new TCHAR[20];
    list.push_back(pLine);
    list.clear();    // is delete called here?
    // is delete pLine; necessary?
}
#include <vecto



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: