There is nothing strange or unsafe in this use. The size of the array is known at compile time, so it can be used in a loop. This is an example of a template function that lets you know the length of an array:
template< class T, std::size_t N >
std::size_t length( const T (&)[N] )
{
return N;
}
Foo f[5];
std::cout << length(f) << "\n";
This should make it clear that you cannot use this method or range-based loops for type C arrays with dynamic size.
, , , std::array ( , ti std::tr1 boost), C-:
extern std::array<float, 100> bunch;
for (auto &f : bunch) {
f += someNumber;
}