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;}
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;}