title: How to return false from a for loop if any of the conditions are false
body: <p>I'm working on a function which should return false if any of the point positions are outside of the defined rectangle boundaries.</p>
  
  <p>My current c++ code is as follows:</p>
  
  <pre><code>bool trackingPointsVisible(){
          //I've got 4 points here
          if(!points.empty()){
                // loop through each of the points
              for(int i=0; i&lt;points.size(); i++){
                     //check if points' x and y positions are out of the boundaries
                  if(points[i].x &lt; -60 || points[i].x &gt; 300 ||
                  points[i].y &lt; -60 || points[i].y &gt; 300){
                     // if any of them are out return false 
                      return false;
                  }else{
                     //if they're within the boundaries, return true
                      return true;
                  }
  
              }
          }
    }
  </code></pre>
  
  <p>For some reason, it returns <code>true</code> even if one of the points if out of the specified boundaries. I don't think this should be the case. Should I rewrite this function and check each point individually or is there another approach?</p>
  
  <p>Could anyone please point what am I doing wrong here? Thanks.</p>