summaryrefslogtreecommitdiffstats
path: root/util.h
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-09-14 11:58:49 -0400
committerDave Brolley <brolley@redhat.com>2009-09-14 11:58:49 -0400
commit775c3771bb4a5f663a763d7c65b1571e24e4b212 (patch)
treedf01d695bcf1f0d0e7fac567a4b917bc273a00e3 /util.h
parentd2c9ec9b6933fbe36834d7ad52be0994e96eb12c (diff)
parentef0e74fc1131f1d217c78aa839d0de731ea7c940 (diff)
downloadsystemtap-steved-775c3771bb4a5f663a763d7c65b1571e24e4b212.tar.gz
systemtap-steved-775c3771bb4a5f663a763d7c65b1571e24e4b212.tar.xz
systemtap-steved-775c3771bb4a5f663a763d7c65b1571e24e4b212.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'util.h')
-rw-r--r--util.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/util.h b/util.h
index b38d01fd..24845545 100644
--- a/util.h
+++ b/util.h
@@ -97,4 +97,16 @@ lex_cast_qstring(std::string const & in)
return out;
}
+
+// Delete all values from a map-like container and clear it
+// (The template is permissive -- be good!)
+template <typename T>
+void delete_map(T& t)
+{
+ for (typename T::iterator i = t.begin(); i != t.end(); ++i)
+ delete i->second;
+ t.clear();
+}
+
+
/* vim: set sw=2 ts=8 cino=>4,n-2,{2,^-2,t0,(0,u0,w1,M1 : */