Yes, templates are useful. But using then for different sizes of an array is just a waste. It's really not any faster to use a constant than a member. I guess if you only used inline functions it wouldn't be a problem, which is a possibility with simple containers. You'd just have to be really careful.
Now that I actually know what templates do, I have to agree. Unfortunately, there is no storage for typename outside of templates. D:
Also:
template<class type1,class type2> function add(type x,type2 y)
{
return x+y;
}
int main()
{
int z=add('x',5);
return 0;
}
Terrible concept, but yeah.