namespace m5 {
namespace stl_helpers {
-template <typename T>
-void
-deletePointer(T &ptr)
-{
- delete ptr;
- ptr = NULL;
-}
-
template <class T>
class ContainerPrint
{
}
};
-// Treat all objects in an stl container as pointers to heap objects,
-// calling delete on each one and zeroing the pointers along the way
-template <template <typename T, typename A> class C, typename T, typename A>
-void
-deletePointers(C<T,A> &container)
-{
- std::for_each(container.begin(), container.end(), deletePointer<T>);
-}
-
// Write out all elements in an stl container as a space separated
// list enclosed in square brackets
template <template <typename T, typename A> class C, typename T, typename A>