title: If else statements with flags c++
body: <p>So, I have this method to check if my queue array is decreasing, the problem when I check is that if the two first terms are decreasing, it says that the whole queue is decreasing but I want it to go over each member of the whole array.
  Decreasing means that each integer is superior to the next one, until the end of the queue. Are my if, else statements wrong?
  If it is decreasing, my boolean should return true, otherwise it should return false:</p>
  
  <pre><code>  template&lt;class T&gt;
  bool queue&lt;T&gt;::isDecreasing() const {
  
      bool flag=false;
  
      for (size_t i = 0; i &lt; _capacity; i++) {
          if(elements[i]&gt;elements[i+1]){
              flag = true;
              return flag;
  
          }else if(elements[i]&lt;=elements[i+1]){
              flag=false;
              return flag;
          }
      }
       return flag;
     }
  </code></pre>