From: brain Date: Fri, 18 Aug 2006 23:13:14 +0000 (+0000) Subject: Change #define DELETE to a template X-Git-Tag: v2.0.23~7347 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=c2bc7f1636f1b923e8c6795dd4311bde0e7bcf55;hp=65e33571defa0dafa0262db1d2ca197943430eea;p=user%2Fhenk%2Fcode%2Finspircd.git Change #define DELETE to a template git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4974 e03df62e-2008-0410-955e-edbf42e46eb7 --- diff --git a/include/inspircd.h b/include/inspircd.h index 209edf65a..f01305b44 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -59,7 +59,11 @@ enum DebugLevel /** Delete a pointer, and NULL its value */ -#define DELETE(x) {if (x) { delete x; x = NULL; }} +template void DELETE(T* x) +{ + delete x; + x = NULL; +} /** Template function to convert any input type to std::string */