summaryrefslogtreecommitdiffstats
path: root/util.h
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-09-10 20:40:10 -0700
committerJosh Stone <jistone@redhat.com>2009-09-10 20:40:10 -0700
commit30c64675b8d77b4dbcd8a5aa6fc90610fef8df00 (patch)
tree6359c0c672fe4359b8e638732f4acd7f085c1180 /util.h
parent5e3e8ffc28f765eb4933f8f167158900588aa51a (diff)
parent729455a739d4755269f20b73d2db231db2a1fdd7 (diff)
downloadsystemtap-steved-30c64675b8d77b4dbcd8a5aa6fc90610fef8df00.tar.gz
systemtap-steved-30c64675b8d77b4dbcd8a5aa6fc90610fef8df00.tar.xz
systemtap-steved-30c64675b8d77b4dbcd8a5aa6fc90610fef8df00.zip
Merge branch 'getscopes'
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 : */