範囲ベースのループのいくつかの例を読むと、2つの主な方法が示唆されています1、2、3、4
std::vector<MyClass> vec;
for (auto &x : vec)
{
  // x is a reference to an item of vec
  // We can change vec's items by changing x 
}
また
for (auto x : vec)
{
  // Value of x is copied from an item of vec
  // We can not change vec's items by changing x
}
上手。
アイテムを変更する必要がない場合vec、IMO、例では2番目のバージョン(値による)を使用することをお勧めします。なぜ彼らはconst参照する何かを提案しないのですか(少なくとも私は直接の提案を見つけていません):
for (auto const &x : vec) // <-- see const keyword
{
  // x is a reference to an const item of vec
  // We can not change vec's items by changing x 
}
良くないですか?それがである間、それは各反復で冗長なコピーを避けませんconstか?