summaryrefslogtreecommitdiff
path: root/src/utils/dtor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/dtor.h')
-rw-r--r--src/utils/dtor.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/utils/dtor.h b/src/utils/dtor.h
index f2c6c1b8..516fd916 100644
--- a/src/utils/dtor.h
+++ b/src/utils/dtor.h
@@ -24,6 +24,7 @@
#ifndef _TMW_UTILS_DTOR_H
#define _TMW_UTILS_DTOR_H
+#include <algorithm>
#include <functional>
#include <utility>
@@ -46,4 +47,10 @@ inline dtor<typename Cont::value_type> make_dtor(Cont const&)
return dtor<typename Cont::value_type>();
}
+template<typename Container>
+inline void delete_all(Container &c)
+{
+ std::for_each(c.begin(), c.end(), make_dtor(c));
+}
+
#endif