Non-type arguments
This was one of the least controversial and most obvious decisions that the committee could make regarding templates. Allowing non-type template arguments was existing practice in many compilers even though it was not part of the ARM. template<int N>
class Array
{
// ...
char data[N];
};
Array<256> a256_char;
Over the years, the committee has refined the definition of what can be
deduced and what sort of non-type arguments are allowed.A non-type argument may be an integral constant expression (for a template parameter of integral type) or the address of an entity with external linkage (for a template parameter of pointer type). Note that string literals are not appropriate arguments for parameters of type char*.
The deduction rules are deliberately very restrictive so that the compiler does not have to do math in order to be able to deduce integral template arguments.