While refactoring code and ridding myself of all those #defines that we\'re now taught to hate, I came across this beauty used to calculate the number of elements in a struc
Simplfying @KTC's, since we have the size of the array in the template argument:
template int arraySize(const T(&arr)[SIZE]) { return SIZE; }
Disadvantage is you will have a copy of this in your binary for every Typename, Size combination.