Why can I reinitialize a constant inside a loop?

Viewed 7193

The compiler throws no warnings or errors for the following code. Is the meaning of the const qualifier being abused? Obviously I cannot reassign it later in the same loop iteration but it does seem to reassign it after each iteration.

Sample code:

for(int i = 0; i < 10; ++i)
{
  const int constant = i;
}
4 Answers
Related