An example is
1 int 2 class Stack {};
Here I think of the C language is how to get the data structure, have to say the template is very convenient things. The above example is a class template, and the function template is actually similar.
Floating-point numbers and class objects are not allowed as non-type template parameters.
Add to the above sentence: this is a historical reason, the author of C + + templates that C + + might allow floating-point numbers and class objects to be used as non-type template parameters in the future.
It's not very good to understand this example.
1 template<char Const * Name>2 class3 4 // File1.cpp5 someclass< " hello A;6 7 // File2.cpp8 someclass< "hello
The explanation of the 12 floor of Http://bbs.csdn.net/topics/340056689#quote is quite clear.
The code above is wrong because the someclass< "Hello" > two files are actually different types ("Hello" addresses are different), but they look the same, and if A and b do anything, they are likely to go wrong.
That is, an internal linked object cannot be an argument to a template.
C + + Template programming-fourth non-type template parameters