Summary
Jason explores the difference between using 'typename' and 'class' keywords in C++ templates. He explains that for most template parameters, these keywords are functionally identical and interchangeable, with the choice being purely stylistic. Jason personally prefers 'typename' as it more clearly indicates that any type can be used, not just class types. He identifies one historical exception (template templates) where 'class' was mandatory, though notes in the video description that C++17 now also allows 'typename' in this context.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[depr.template.template]60% match -
[temp.mem.class]58% match -
[temp.class]57% match -
[temp.arg.template]56% match -
[temp.class.general]56% match -
[temp.local]48% match -
[diff.cpp14.temp]46% match -
[temp.alias]45% match -
[temp.decls.general]44% match -
[temp.spec.partial.general]43% match