3 ms·
Note that Rust's system is a generics system, and there's less metaprogramming that can be done by it. Namely, the property mentioned in the post where "So if I
by Manishearth 10y ago
Note that Rust's system is a generics system, and there's less metaprogramming that can be done by it. Namely, the property mentioned in the post where "So if I try to use this template with the wrong type, after a bunch of template and macro expansion the compiler will print out a cryptic error showing the templated code and the failed type substitution." does not exist in Rust, since you specify bounds in the API itself.
This is both a blessing and a curse. As a blessing, it leads to very neat, clean, APIs and you never have to worry about such template expansion errors. As a curse, some of the more complex bits of C++ metaprogramming (check out what people achieve with SFINAE) are not possible. I personally think the pros outweigh the cons, but many people from the C++ world really like the power of template metaprogramming in C++. Rust is planning on offering procedural macros which address some of the use cases, but not all.