title: Which version of safe_delete is better?
body: <pre><code>#define SAFE_DELETE(a) if( (a) != NULL ) delete (a); (a) = NULL;
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>template&lt;typename T&gt; void safe_delete(T*&amp; a) {
    delete a;
    a = NULL;
  }
  </code></pre>
  
  <p>or any other better way</p>