N
Noah Roberts
peter said:Noah Roberts skrev:
Sure? Examples given in this thread would specifically behave that way.
Far to often you write if (p != 0) p->action() instead of assert(p !=
0); p->action();
How are you applying logic here?
1) what example of pointer access would work if ptr is 0 and not
otherwise?
2) what is the relevance of the assert statement you make above?
That is a small problem as this is only something to do while
debugging.
Yes, it is good to introduce hard to read, platform dependant,
undefined behavior during debugging and then replace it with different
code on release.
The arguments against setting a pointer to 0 after deletion just keep
getting dumber and dumber...I don't really find that surprising.