X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=libtest%2Fcommon.h;h=7be0221c343b57bb919a8011a0497c990cc171c4;hb=44be5e8f297c9719ab7d06eb0287a1a5d00a515d;hp=6c7e294c576aac4f99c3e63e45198dc81bcf94b1;hpb=23dca174eef8d846e3d4402729b57f6ded035e64;p=awesomized%2Flibmemcached diff --git a/libtest/common.h b/libtest/common.h index 6c7e294c..7be0221c 100644 --- a/libtest/common.h +++ b/libtest/common.h @@ -97,3 +97,25 @@ #include #include +struct FreeFromVector +{ + template + void operator() ( T* ptr) const + { + if (ptr) + { + free(ptr); + ptr= NULL; + } + } +}; + +struct DeleteFromVector +{ + template + void operator() ( T* ptr) const + { + delete ptr; + ptr= NULL; + } +};