title: C++ Ternary If Statement - Wish to have no "else" part
body: <p>I was to <code>delete []</code> some allocated memory if a condition is met: The condition is that <code>double* m_x == nullptr</code></p>
  
  <p>I am trying to do this:</p>
  
  <pre><code>(m_x == nullptr) ? (delete [] m_x);
  </code></pre>
  
  <p>However the compiler requires that I have the "else part" after a <code>:</code> like so:</p>
  
  <pre><code>(m_x == nullptr) ? (delete [] m_x) : ;
  </code></pre>
  
  <p>But I don't have anything to put after the colon.</p>
  
  <p>Is there a way around this? Apart from:</p>
  
  <pre><code>if(m_x == nullptr)
          delete [] m_x;
  </code></pre>
  
  <p>Thanks,</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I meant <code>if(m_x != nullptr)</code> sorry copied it wrong</p>