Skip to content

class vs typename #2288

Discussion options

You must be logged in to vote

It's both historical, and reflects the Standard's editorial convention. We don't feel super strongly about it - I personally prefer typename (which is why it's common in the tests, which have been less strict about following the same conventions as product code), but I don't think it's worth converting the whole codebase over (unlike clang-format, braces everywhere, etc.).

Using class versus typename to express a connotation of "only class types" versus "literally any type" could be reasonable for certain codebases that are very strict about it, but because that isn't a widespread convention, I personally don't view the keywords as carrying that connotation (whereas struct versus class ca…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AlexGuteniev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants