would rust core memory safety features have over this except when i forget to use my model :
use const& for immutable value passing
use shared_ptr when mutable
don't call delete manually use RAII always
use templates when you can sense a pattern to compress it.. like eliminating wrapper classes via perfect forwarding?
don't do fancy stuff
Most Rust features are about more heavily discouraging unsafe usage, but nothing in C++ really prevents you from just using a raw pointer somewhere. So what you might get from Rust is enforcement of that kind of usage
And ofc all the small benefits of using any modern language, like slightly better generics, slightly better reflection, slightly better macros, ...
But that stuff is not super important imo, it's just slightly modernized in-language tooling
The guy that does my code reviews will relatively reliably prevent me from using raw pointers
I don't really even like Rust, but ostensibly the compiler does more code review-y tasks like that
Yeah, they want to fold them in G++ as static analysis too, which is pretty good
Обсуждают сегодня