Next: Copy constructor and assignment
Up: Tips and Tricks
Previous: Tips and Tricks
  Contents
Here are some helpful templates for handling memory deletion:
41#41
Using the above templates does the following important things:
- Sets the pointer to NULL upon deletion. This prevents stale
pointer variables.
- Makes the choice between ``array'' and ``normal'' memory deletion
more obvious. It is too easy to forget the [] for an array. Having
to type either ``ARRAY'' or ``POINTER'' makes you think about the
decision a bit more.
Falko Kuester
2001-08-24