It's a straight-forward rule that (I think) I have mostly internalized. But coming from C++, I was initially mystified.
#include <Eigen/Dense> // a library where I know it's required
using namespace Eigen;
int main() {
VectorXd zeros = VectorXd::zeros(5);
VectorXf zeros_float = zeros.template cast<float>();
return 0;
}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...