I use:
template<class T>
Arbol<T>::Arbol(){
}
when T
is going to make a class.
and use:
template<typename T>
Arbol<T>::Arbol(){
}
when T
goes to be a type for example bool
, char
os fundamental types.
But looking at a piece of code from a program (not created by me) I saw that I used typename
where I usually use class
, and until now I had not noticed that. if now you ask me why, because I could not say one hundred percent why, but maybe somehow I (imagine) that the compiler differentiated when it was a type included in the language and acted accordingly.
My question is:
Is it the same to use one or the other?
Well, the two of them have now tested it and they work well but I do not know if I'm missing something, or maybe there is some subtle difference between class
and typename
in this context.