Are there any good reasons (except \"macros are evil\", maybe) NOT to use the following macros ?
#define DELETE( ptr ) \\
i
Your macro fails for several reasons:
DELETE (getPtr()); won't compile, because you can't set the function call to null. Or if the pointer is const, your macro will also fail.delete NULL is allowed by the standard.Finally, as grimner said, you're trying to solve a problem that shouldn't exist in the first place. Why are you manually calling delete at all?` Don't you use the standard library containers? Smart pointers? Stack allocation? RAII?
As Stroustrup has said before, the only way to avoid memory leaks is to avoid having to call delete.