Are there any good reasons (except \"macros are evil\", maybe) NOT to use the following macros ?
#define DELETE( ptr ) \\
i
NULL
after deallocation tends to mask errorsif (ptr != NULL)
checks as a flow control mechanism. Personally, I consider
this a code smell along the lines of void foo(int arg)
being replaced with void
foo(int arg, bool doAdvancedThings=false)
shared_ptr
and
its relatives should always be used for ownership, raw pointers can be used for
other accessif (ptr != NULL)
instead of if (ptr)
... comparing pointers is another code smell