在模板中,可以通过参数不同类型,下面讨论的是使用整数值作为模板参数的最常见的例子:
template<class T, int N>struct array{
T elem[N];
int size() const {return N;}
};