From: Chris Lattner Date: Mon, 2 Jul 2001 01:09:41 +0000 (+0000) Subject: Addition of 'deleter' function. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=577b15f70e3a1461033858e357f8ed3e10705c21;p=oota-llvm.git Addition of 'deleter' function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Tools/STLExtras.h b/include/llvm/Tools/STLExtras.h index d7f8320d4cc..933db3a8ff4 100644 --- a/include/llvm/Tools/STLExtras.h +++ b/include/llvm/Tools/STLExtras.h @@ -43,6 +43,18 @@ struct bitwise_or : public binary_function { }; +// 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); +// +template +static inline void deleter(T *Ptr) { + delete Ptr; +} + + + //===----------------------------------------------------------------------===// // Extra additions to //===----------------------------------------------------------------------===//