POD*_*POD 2 c++ memory-management copy function vector
我有一个处理和存储大量数据的函数,然后它将结果作为类的向量返回.存储在此函数中的数据量非常大,我希望在完成其工作后清除该函数的存储内存.是否有必要这样做(功能是否自动清除内存)还是应该通过某些功能清除内存?
更新:
vector<customers> process(char* const *filename, vector<int> ID)
{
vector<customers> list_of_customers;
(perform some actions)
return list_of_customers;
}
Run Code Online (Sandbox Code Playgroud)