Good suggestion, thanks. I think this is a feature we should definitely have, so I just added it! (You'll have to pull the latest version of ITensor to get it.)
What I added is a function called iterInds
which you in a range-based for loop, which gives the behavior you asked about.
Here is a sample code using it:
auto i = Index("i",2);
auto j = Index("j",3);
auto k = Index("k",4);
auto is = IndexSet(i,j,k);
auto T = randomTensor(i,j,k);
for(auto it : iterInds(T))
{
Print(it[0]);
Print(it[1]);
Print(it[2]);
Print(T.real(it));
println();
}
PrintData(T);