4 ms·
Rust doesn't care about details? Have you used it? :) I've found C++'s templates to be both less strict / less well-defined and in many ways more powerful than
by api 6y ago
Rust doesn't care about details? Have you used it? :)
I've found C++'s templates to be both less strict / less well-defined and in many ways more powerful than Rust's template system. Rust's template system is fully typed and has some important restrictions, the most significant being that it's hard to template on multiple different types and it's hard/impossible to template on integers or other concrete types. C++'s template system is a glorified preprocessor, giving you much power but also an enormous Howitzer foot cannon.
- choeger 6y agoI did use rust and I never came across a template system ;). However, rust makes certain design choices that C++ leaves open. They aren't too dissimilar in many aspects, and rust definitely is the sound of the two languages. But what I meant was that in C++ there will always be a very precise distinction between the tiniest nuances of how code behaves because the language wants to allow that level of control. Take for instance the difference between assignment and construction. Another language might decide that one is explained by the other and be done with it. C++ makes a distinction.