for (int& i : array) {
//do something on i
}
Does this count as "reseating reference i
to different objects"?
This, appearently, let i
refers to array[0]
in first iteration, array[1]
in second iteration, ..., and so forth.
Edit 1 in response to comment: I know exact what happens in implementation level. I used compiler explorer to see what does this compile to and I know that this looks completely same as other type of iteration (some level of optimization is assumed). This question is more about on the language level, not implementation.