summaryrefslogtreecommitdiffstats
path: root/util.h
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-09-16 12:18:50 -0400
committerDave Brolley <brolley@redhat.com>2009-09-16 12:18:50 -0400
commit0f4a9cb5967714ace01e0941592040b8c1d83ee7 (patch)
treef97784dbd9392694931c1be99abf7920f6f0484b /util.h
parentd83d7b513d38791751e46a05e382b1e6876abefc (diff)
parentd833f810e4ffaf5c9c16eebc7f10b9d14e53e508 (diff)
downloadsystemtap-steved-0f4a9cb5967714ace01e0941592040b8c1d83ee7.tar.gz
systemtap-steved-0f4a9cb5967714ace01e0941592040b8c1d83ee7.tar.xz
systemtap-steved-0f4a9cb5967714ace01e0941592040b8c1d83ee7.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 : */