News for hackers. Stuff that matters.
Re:Bastion of the Turbofish (2020) by nzmsv on Saturday February 06, 2021 @11:10AM (#26047452)
I'm sure you know better, but at first glance this seems wrong. Reason: `main` is not itself a template, so `cast` is not a dependent name.

C++ compilers used to be liberal about accepting unnecessary instances of the `typename` keyword so lots of people would just sprinkle them everywhere. Modern versions of both Clang and GCC call this out.

The actual rule: https://en.cppreference.com/w/cpp/language/dependent_name#Th...

Re:Bastion of the Turbofish (2020) by vbarrielle on Saturday February 06, 2021 @03:40PM (#26049729)
You're right, since I'm frequently using templated functions I encounter this issue quite often, but here when I wanted to give an example I forgot I needed to be in a dependent context. I guess I'd better test my example next time I want to give one...