summaryrefslogtreecommitdiff
path: root/src/stl-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stl-utils.h')
-rw-r--r--src/stl-utils.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/stl-utils.h b/src/stl-utils.h
new file mode 100644
index 0000000..a48b7d5
--- /dev/null
+++ b/src/stl-utils.h
@@ -0,0 +1,19 @@
+#ifndef STLUTILS_H_
+#define STLUTILS_H_
+
+template<class T>
+struct del_fun_t
+{
+ del_fun_t& operator()(T* p) {
+ delete p;
+ return *this;
+ }
+};
+
+template<class T>
+del_fun_t<T> del_fun()
+{
+ return del_fun_t<T>();
+}
+
+#endif
contact: Jan Huwald // Impressum