title: Ternary operator and increment operator
body: <p>Is this a valid / sound way of resetting a counter if a condition is not met? It is the most compact way I could think of.</p>
  
  <pre><code>int counter = 0;
  int a,b;
  
  // Do .. and assign a and b 
  
  counter = ((a&lt;b) ? counter++ : 0); 
  </code></pre>