title: comparison operator values C++
body: <p>We all know C++ (while not a superset) is pretty much derived from C.</p>
  
  <p>In C++, the operators  &lt;, &lt;=, >, >=, ==, and != all have boolean return values.
  However, in C, the same operators returned 1 or 0, since there was no 'bool' type in C.</p>
  
  <p>Since all integer values except 0 are treated as "true", and 0 is "false", I want to know:</p>
  
  <p>Does C++ still restrict the return values of the operators to be 1 vs 0, or does a 'true', from one of these operators, return any 1-byte value, so long as it isn't 0?</p>
  
  <p>I want to know since using these return values as explicit 1 or 0 would be useful in bitwise operations without branching.</p>
  
  <p>As a terrible example, take the following:</p>
  
  <pre><code>bool timesTwo;
  int value;
  
  //...
  
  if(timesTwo)
      value &lt;&lt; 1;
  
  //vs
  
  value &lt;&lt; (int) timesTwo;
  </code></pre>