diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-18 23:13:14 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-18 23:13:14 +0000 |
commit | c2bc7f1636f1b923e8c6795dd4311bde0e7bcf55 (patch) | |
tree | da0017900c1619de1fa8750f3caee8e9ffb9192d /include | |
parent | 65e33571defa0dafa0262db1d2ca197943430eea (diff) |
Change #define DELETE to a template
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4974 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r-- | include/inspircd.h | 6 |
1 files changed, 5 insertions, 1 deletions
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<typename T> void DELETE(T* x) +{ + delete x; + x = NULL; +} /** Template function to convert any input type to std::string */ |