Please consider this code:
#include template void f(T x) { std::cout << sizeof(T) << \'\\n\'; } int main
You can also use templates like the following:
template inline std::size_t number_of_elements(T (&ary)[N]) { return N; }
This little trick will cause compile errors if the function is used on a non-array type.