title: Range based loops: Auto changes meaning in C++11
body: <p>I was trying to make a range based lopp like this in C++11:</p>
  
  <pre><code>std::vector&lt;Satellite&gt; Satellites; // Class member
  //...
  
  int number = 1;
  for(auto sat : this-&gt;Satellites) {
      sat.setNumber(number++);
  }
  </code></pre>
  
  <p>And I'm getting this warning:</p>
  
  <blockquote>
    <p>'auto' changes meaning in C++11; please remove it [-Wc++0x-compat]</p>
  </blockquote>
  
  <p>Of course I could stick to <code>for(Satellite sat : this-&gt;Satellites)</code>, but I was trying to test the auto keyword.</p>
  
  <p>I had read that usage of auto was possible with C++11, but <a href="http://blog.smartbear.com/c-plus-plus/the-biggest-changes-in-c11-and-why-you-should-care/" rel="nofollow">recently I found</a> that it changed since C++0x (or it looks like it did!):</p>
  
  <blockquote>
    <p>The keyword auto isn’t new; it actually dates back the pre-ANSI C era.
    However, C++11 has changed its meaning; auto no longer designates an
    object with automatic storage type. Rather, it declares an object
    whose type is deducible from its initializer. The old meaning of auto
    was removed from C++11 to avoid confusion.</p>
  </blockquote>
  
  <p>So: Am I able to use it like this with C++11 and my problem is at the IDE (Eclipse CDT Juno), or should I use it in a different way (or remove the auto keyword at all)?</p>