Although there is no technical difference between class and typename for type template parameters, we may argue that typename better conveys its semantic meaning.
To many people's chagrin, class is a much overloaded keyword. When using the keyword class, are we referring to a custom class or simply a placeholder for a templated type? Clearly, typename has better semantics in my opinion.
Does anyone have strong feelings about this? I personally have no real issue either way; I tend to use typename in my own code, but class and typename are identical in this context.
Although there is no technical difference between
class
andtypename
for type template parameters, we may argue thattypename
better conveys its semantic meaning.To many people's chagrin,
class
is a much overloaded keyword. When using the keywordclass
, are we referring to a customclass
or simply a placeholder for a templated type? Clearly,typename
has better semantics in my opinion.