1 2 3 4 5 6 7 8 9 10 11
#pragma once #include "util.h" template <typename T> void safe_free(List<T *> & ptr_list) { for (T * obj : ptr_list) delete obj; ptr_list.clear(); }