template<class T,std::size_t N>
std::size_t size(T (&)[N]){return N;}

int a[] = {1,2,3,4,5,6};
int b[size(a)];

これってなぜ駄目なの?