I was to delete []
some allocated memory if a condition is met: The condition is that double* m_x == nullptr
I am trying to do this:
(m_x == nullptr) ? (delete [] m_x);
However the compiler requires that I have the "else part" after a :
like so:
(m_x == nullptr) ? (delete [] m_x) : ;
But I don't have anything to put after the colon.
Is there a way around this? Apart from:
if(m_x == nullptr)
delete [] m_x;
Thanks,
EDIT
I meant if(m_x != nullptr)
sorry copied it wrong