Mixing typename and class
In several implementations of bases and other templates there is a mix of typename
and class
within the template declaration.
Example:
template<typename GV, int k, class MI, typename R>
class LagrangePreBasis;
The behavior is nearly the same in pre c++17 and is the same in the recent standard. But it is very irritating to read and when extending the classes I don't know which one to use. Is there a specific code style decision when to use typename
and when to use class
in dune-functions, like containers are always class
and scalar types are always typename
? I know, this is just about code style, but when it makes the code more difficult to understand or to read maybe one should fix a style or at least fix it within one file.
My personal preference is to always use class
in templates (just because it is shorter), but I'm fine with always typename
, too.