Update assert rule.
[awesomized/libmemcached] / libtest / common.h
index 6c7e294c576aac4f99c3e63e45198dc81bcf94b1..7be0221c343b57bb919a8011a0497c990cc171c4 100644 (file)
 #include <libtest/dns.hpp>
 #include <libtest/formatter.hpp>
 
+struct FreeFromVector
+{
+  template <class T>
+    void operator() ( T* ptr) const
+    {
+      if (ptr)
+      {
+        free(ptr);
+        ptr= NULL;
+      }
+    }
+};
+
+struct DeleteFromVector
+{
+  template <class T>
+    void operator() ( T* ptr) const
+    {
+      delete ptr;
+      ptr= NULL;
+    }
+};