title: Evaluate struct as a bool
body: <p>I'm stuck on evaluating a struct as a bool in c++</p>
  
  <pre><code>struct foo {
    int bar;
  };
  foo* x = (foo*)malloc(sizeof(foo));
  int y = ( x ) ? 3 : 4;
  </code></pre>
  
  <p>This is what happens when it is ran: </p>
  
  <pre><code>could not convert 'x' from 'foo' to 'bool'
  </code></pre>
  
  <p>When searching for bool operators, I can only find ways to overload the comparator bool operator.  Is there a straight up evaluate struct as a bool operator?</p>
  
  <p>I also want to keep foo as plain old data if possible.</p>