Add a trivial functor for use with unique_ptrs managing memory that needs to be freed...
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 29 Aug 2014 22:05:31 +0000 (22:05 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 29 Aug 2014 22:05:31 +0000 (22:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216790 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/STLExtras.h

index 1cef3933b5d6b2112f5c86f099d07de952bf18a0..f69a15bdc255061205bf3180c3c3364db04c28d7 100644 (file)
@@ -530,6 +530,12 @@ make_unique(size_t n) {
 
 #endif
 
+struct FreeDeleter {
+  void operator()(void* v) {
+    ::free(v);
+  }
+};
+
 template<typename First, typename Second>
 struct pair_hash {
   size_t operator()(const std::pair<First, Second> &P) const {