▲ | lII1lIlI11ll 4 days ago | |||||||
> Memory safety isn't much of a problem in C++ anymore with smart pointers, std::move. Of course it is! You can still access an object after std::moving it somewhere, return references to local stack variables from functions, double-delete (or zero!), use uninitiated variables and do bunch of other things that rightfully caused notoriety C++ has got. And am saying it as someone who writes C++ every workday, unfortunately. | ||||||||
▲ | throwaway18373 4 days ago | parent [-] | |||||||
You "write C++ every workday" and don't even know that moved-from objects are guaranteed to be valid? > return references to local stack variables from functions > use uninitiated variables Any properly configured compiler will catch and warn about those errors. > double-delete (or zero!) Not a real issue if you're using smart pointers. Sure, you can program with no compiler warnings and no smart pointers—but nothing is stopping you from wrapping your entire Rust program in "unsafe" and doing all those things there as well. Programming languages can only do so much to save people from their own incompetence. | ||||||||
|