3 ms·
The OP was talking about writing performance critical code in either language. Template metaprogramming is not a language feature that is needed when I write c
by virtualritz 4y ago
The OP was talking about writing performance critical code in either language.
Template metaprogramming is not a language feature that is needed when I write code that is close to the metal.
- shaklee3 4y agoit absolutely is. I do a lot of embedded programming, and tmp is used heavily in libraries to offload as much as possible to compile time.
- virtualritz 4y agoCompile time code generation can be done in many ways. Again, templates are not a feature that is part of the close-to-the-metal part of C++. What exactly does template metaprogramming in C++ allow you to do that you could not do in Rust? In the context of performance critical code? Besides, Rust has generics and macros. The latter are arguable as powerful (if almost as cumbersome to debug) as C++ templates. See also https://news.ycombinator.com/item?id=16283956 https://news.ycombinator.com/item?id=16283956