why not simply have a 'foreach'....
"why not simply have a 'foreach' ?
foreach (x in v) x++;"
Because that would require reserving another keyword, unnecessarily breaking lots of existing code , when 'for' is already reserved and easy to understand, the only new bit of syntax is the reuse of the ':' the rest is all normal C++
You could just as easily write
std::vector<int> v
for(int i : v) ....
Backwards compatibility.... for when your language is not just a fashionable toy