Hacker News new | ask | show | jobs
by imtringued 1250 days ago
Ok but the static analysis tools that are equivalent to what Rust does involve bolting a borrow checker on to C++ at which point you might question what you are trying to achieve because you can't reuse any of the existing C++ code in this configuration as all the other C++ developers failed to use your specific static code analysis setup.
1 comments

And also, unlike Rust, C++ was not designed to support the borrow checker, so any code that you’re writing might not even be analysable properly by the C++ borrow checker
See here for the current status in VC++ as of last December. Plenty of work still to do.

https://devblogs.microsoft.com/cppblog/high-confidence-lifet...

Sure. As was obvious from the beginning for anyone who's tried to do lifetime analysis on mostly-unannotated C++, this is going to become another "bug reporting" tool that doesn't accomplish anything close to what Rust does. Most likely, all it will do is catch a few of the more obvious bugs so they pass various tutorial examples people use to show why you need borrow checking, leading C++ programmers will believe the problem is solved when it isn't.