title: Nested range-based for-loops
body: <p>I have the following code using range-based <code>for</code>-loops (C++11):</p>
  
  <pre><code>vector&lt;atom&gt; protein;
  ...
  for(atom &amp;atom1 : protein) {
      ...
      for(atom &amp;atom2 : protein) {
          if(&amp;atom1 != &amp;atom2) {
                  ...
          }
      }
  }
  </code></pre>
  
  <p>Is there a better/cleaner/faster way to write this nested loops? Isn't there a way to include the <code>if</code> condition in the second loop?</p>