aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Tools/STLExtras.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Tools/STLExtras.h b/include/llvm/Tools/STLExtras.h
index d7f8320d4c..933db3a8ff 100644
--- a/include/llvm/Tools/STLExtras.h
+++ b/include/llvm/Tools/STLExtras.h
@@ -43,6 +43,18 @@ struct bitwise_or : public binary_function<Ty, Ty, bool> {
};
+// deleter - Very very very simple method that is used to invoke operator
+// delete on something. It is used like this:
+//
+// for_each(V.begin(), B.end(), deleter<cfg::Interval>);
+//
+template <class T>
+static inline void deleter(T *Ptr) {
+ delete Ptr;
+}
+
+
+
//===----------------------------------------------------------------------===//
// Extra additions to <iterator>
//===----------------------------------------------------------------------===//