3 ms·
> typeOrValue is a type int if the solution to the Post Correspondence Problem is “yes”, and a value 0 of type int if the solution is “no”, using SFINAE Isn't
by ridiculous_fish 7y ago
> typeOrValue is a type int if the solution to the Post Correspondence Problem is “yes”, and a value 0 of type int if the solution is “no”, using SFINAE
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...
- grandmczeb 7y agoI 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. https://en.cppreference.com/w/cpp/language/dependent_name https://en.cppreference.com/w/cpp/language/dependent_name
- InfiniteRand 7y agoThe example given in the original post involves a dependent name
- grandmczeb 6y agoIt 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.