組み合わせを見つけるには、同じコンテナ上で2つのループが必要です。
the first iterates over elements:
pick an element
iterate over the elements on the left
print the first and the second iterated elements
だからここに間違った例があります:
vector<int> vec;
for(size_t i=0; i< 10 ; ++i) vec.push_back(i);
for(auto i : vec)
{
auto j = i.increaseBy(1);
for(j : vec) cout << i << j << "\n";
}
この質問では、要素を反復処理する単純な方法だけでなく、範囲ループの構文にもっと多くのものがあるかどうかに興味があります。c++11に関するドキュメントはあまりありません。