It would seem that the "for each" style of syntax available in C++11 permits array iteration without knowledge of the actual size of the array (number of elements). I assume, since it is part of the new standard, that this is perfectly safe, even for C arrays. Typically, you must also separately know the size of a C array before manipulating it, but I want verification from anyone experienced with this new C++ technique that it works exactly as you'd expect:
extern float bunch[100];
for (float &f : bunch) {
f += someNumber;
}
Is there anything I should know about non-obvious side effects or disadvantages to this technique? It doesn't show much in code I see, probably because most of the code was written before this was in the standard. Want to make sure its rare usage isn't because of some other reason not well-known.