After I performed some operations on the vector of structs, I need to free the memory. I suppose clear() will not be sufficient, but I'm not sure how to perform individual delete.
This outputs the following error:Code:typedef std::vector<VertexRAM> VecVertexRAM; // definition of a vector of structs template <typename type> void freeFromMemory(std::vector<type>& myVec) { typename std::vector<type>::iterator myIter=myVec.begin(); while(myIter!=myVec.end()) { delete(*myIter); ++myIter; } myVec.clear(); }
Any ideas on how to do this? ThanksCode:error: type ‘struct VertexRAM’ argument given to ‘delete’, expected pointer




Reply With Quote