+ 1
How does specialization work with two templates?
8 Réponses
+ 1
There is none. In the example case I prefer typename since typename actually denominates what U and T are intended to be: any type you want (and in the example case it's int and char). If I would only pass classes, I would use the class keyword.
+ 1
Btw, to name stuff clearly: U and T are template parameters and the template is the class A.
0
You mean partial specialization?
0
I mean, if I need to specialize a class which uses 2 different templates, let's say T and U, if I need to make a special behaviour for when U is a char, what'll be the syntaxe?
0
Btw, some older compilers have problems with the partial template specialization. In other words: it doesn't work, even though it's in the standard they try to implement.
0
Thanks! And BTW, what is the difference between naming templates class or typename?
0
Thx for the precision :)