4 ms·
In C++, you can’t have an interface without virtual unless you jump through hoops. In rust, you can have traits without dyn. That is, static polymorphism is t
by dkersten 5mo ago
In C++, you can’t have an interface without virtual unless you jump through hoops.
In rust, you can have traits without dyn.
That is, static polymorphism is the default in rust, while in c++ you must jump through hoops for it (eg, see the excellent EnTT’s static polymorphism companion library).
- pjmlp 5mo agoYes you can, you only need to adopt modern C++ with concepts, compile time execution and now compile time reflection.
- dkersten 5mo agoI feel like it’s still missing the point. In a discussion about devitalisation, I thought it was interesting that it’s not something that you have to think about in Rust, while in C++ you do.
- pjmlp 5mo agoOf course you do, it depends on how the application architecture looks like. I also have my share of hobby coding in Rust.
- deleted 5mo ago[deleted]