Re:Proving that C++'s grammar is undecidable
by grandmczeb on Wednesday April 29, 2020 @12:09AM
(#23015250)
I think typename is only required inside of template definitions.
> The keyword typename must only be used in template declarations and definitions and only in contexts in which dependent names can be used.
Re:Proving that C++'s grammar is undecidable
by InfiniteRand on Wednesday April 29, 2020 @03:48PM
(#23023346)
The example given in the original post involves a dependent name
Re:Proving that C++'s grammar is undecidable
by grandmczeb on Wednesday April 29, 2020 @06:44PM
(#23025443)
It has to be both dependent and inside of a template definition. The example is a normal function declaration. The linked article has a couple examples.
Isn't this where the `typename` keyword comes in? `typename` is required when using a qualified (meaning ::) dependent (it references a template parameter) identifier as a type. My understanding is that uses of types without typename is a common helpful extension but is not strictly conforming.
C++ language lawyers, please check my work...