title: true/false precedence in bool recursive function
body: <p>I've done some reading of previous posts and I've learned some things but want to verify how some loops are working.  In reading, am I right in understanding that "true" has higher precedence than "false"?  For instance:</p>
  
  <pre><code>/.../
  return (true || false);
  </code></pre>
  
  <p>will return "true" (regardless of order)?</p>
  
  <p>If I have a boolean recursive function that calls 3 variations of itself...all I need is for one version to return true for the whole funct to return true, correct?  The function below creates it's stack frame, then the return call creates 3 more stack frames and runs through the calls, then if one returns true the whole funct returns true because true has precedence over false...  Is this assumption correct?</p>
  
  <p>Ie:</p>
  
  <pre><code>/* This function is taking a given weight and seeing if it can be offset by available 
   * weights. Depending on what weights are available, the weights can be directly opposed
   * to "weight" (opposite side of scale) or added to... The recursive calls will either all 
   * return false, all return true, or a variation thereof.  All that I can is that if one 
   * branch returns true, the overall function returns true...
  */
  
  bool CanMeasure(int weight, std::vector&lt;int&gt; &amp;availableWeights, int index = 0)
  {
      /.../
      // the below can return all true, all false, or some variation thereof...
      return (CanMeasure(weight + availableWeights[index], availableWeights, index + 1) ||
              CanMeasure(weight - availableWeights[index], availableWeights, index + 1) ||
              CanMeasure(weight, availableWeights, index + 1));
  }
  </code></pre>
  
  <p>Thanks guys!</p>