If you're wondering, "What is the turbofish?", it is the awkward syntax Rust requires when specifying generic arguments in an expression, such as:
Vec::<u8>::new() Vec::<u8>::new() #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...
And i came from being a Python "kill all syntax!" zealot back in the day, hah. Funny how in both Types and Syntax i have migrated from minimalist to explicitness over the years. I was such a zealot on both fronts in those Python days.
let x: Vec<u8> = vec![]; // spelled Vec<u8> in "type context"
let x = Vec::<u8>::new(); // spelled Vec::<u8> in "expression context"> let x: Vec<u8> = Vec::new();