diff options
author | Ira Rice <irarice@gmail.com> | 2008-09-25 00:15:44 +0000 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2008-09-25 00:15:44 +0000 |
commit | 489a429bea6739dfa25503b9329bd9e33bffb856 (patch) | |
tree | 8112f6fd988fdc0610329b6bc14ee3f9d5801092 /src/utils | |
parent | 2dc8eadff1e67bb70b1772ecc19c9e1e2e40a5b4 (diff) | |
download | mana-489a429bea6739dfa25503b9329bd9e33bffb856.tar.gz mana-489a429bea6739dfa25503b9329bd9e33bffb856.tar.bz2 mana-489a429bea6739dfa25503b9329bd9e33bffb856.tar.xz mana-489a429bea6739dfa25503b9329bd9e33bffb856.zip |
Merged the Tametomo branch into trunk.
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/dtor.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils/dtor.h b/src/utils/dtor.h index 3b8aeb0e..29cde178 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,11 @@ 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 |