Addition of 'deleter' function.
authorChris Lattner <sabre@nondot.org>
Mon, 2 Jul 2001 01:09:41 +0000 (01:09 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 2 Jul 2001 01:09:41 +0000 (01:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Tools/STLExtras.h

index d7f8320d4cc5be56ac6ca888b833ce4f83d9a19a..933db3a8ff4ffb1ceef0c450e5e14956d499be44 100644 (file)
@@ -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>
 //===----------------------------------------------------------------------===//