using namespace std;
template <typename T, unsigned int S>
unsigned int array_size(const T (&)[S])
char a = "Hello, world!";
unsigned int s = array_size(a);
cout << s << endl;
The output of the program is 14.
T(&)[S] is the type of the passed in parameter, i.e. T (&in)[S], where "in" is the reference of the array "a" in our case. When doing the type deduction, the compiler will match T with char and S with 14.