I double checked that in VStudio 2015.
Well, try a no-shit compiler then: https://godbolt.org/g/fzUlOH
mov edi, .L.str
xor esi, esi
xor eax, eax
call printf
I challenge you to write code that is free of those super-heavyweight abstractions and that performs significantly better than this.
Inline assembly allowed if you like... :)
(EDIT: I just noticed that I'm only printing out indices (identical to what you're doing) when actually I intended to print values from the array, which is somewhat more meaninful for ranges -- hence the superfluous array. Just ignore that.
Results in basically the same code either way, only a load from memory instead of an immediate load. Same if you use std::array or even std::vector instead of a C array too, by the way, only a call to operator new and operator delete at the beginning/end of main in the case of using a vector, which is however a kinda obvious necessity if you dynamically allocate something).