E
edward.birch
Can anyone see anything wrong with the following code?
(CONTAINER can be list, vector, set, ...)
template <class T> void Destroy(T * p) { delete p; }
void CleanUp(std::CONTAINER<ContainerType *> & Container)
{
std::foreach(Container.begin(), Container.end(),
Destroy<ContainerType>);
Container.clear();
}
(CONTAINER can be list, vector, set, ...)
template <class T> void Destroy(T * p) { delete p; }
void CleanUp(std::CONTAINER<ContainerType *> & Container)
{
std::foreach(Container.begin(), Container.end(),
Destroy<ContainerType>);
Container.clear();
}