How does this "size of array" template function work?

Viewed 60751

Can someone explain how this code works? I know that the purpose of this code is to get the length of an array, but I don't know how this code works:

template<typename T, int size>
int GetArrLength(T(&)[size]){return size;}
1 Answers
Related