diff options
author | Josh Stone <jistone@redhat.com> | 2009-09-10 20:40:10 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-09-10 20:40:10 -0700 |
commit | 30c64675b8d77b4dbcd8a5aa6fc90610fef8df00 (patch) | |
tree | 6359c0c672fe4359b8e638732f4acd7f085c1180 /util.h | |
parent | 5e3e8ffc28f765eb4933f8f167158900588aa51a (diff) | |
parent | 729455a739d4755269f20b73d2db231db2a1fdd7 (diff) | |
download | systemtap-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.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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 : */ |