4 ms·
With static analysis most misuse can also be detected: https://godbolt.org/z/UE-Mb0 https://godbolt.org/z/UE-Mb0, which provides more flexibility than Rust even
by htfy96 8y ago
With static analysis most misuse can also be detected: https://godbolt.org/z/UE-Mb0 https://godbolt.org/z/UE-Mb0, which provides more flexibility than Rust even with NLL
- roca 8y agoI'm not aware of any evidence that C++ Lifetimes will detect "most misuse". It will detect some common lifetime errors. It will certainly fail to detect other common lifetime errors. https://robert.ocallahan.org/2018/09/more-realistic-goals-for-c-lifetimes-10.html https://robert.ocallahan.org/2018/09/more-realistic-goals-fo... Since it fails to detect common lifetime errors, it's not surprising it's more "flexible" than Rust NLL, which prevents all lifetime errors.
- htfy96 8y agoThe true negative in the post has been fixed. Rust also doesn't prevent all dangling references as long as you depend on some unsafe third-party library/external library/libc calls and use them in an improper way.
- masklinn 8y ago> which provides more flexibility than Rust even with NLL Not detecting issues being more flexible than detecting issues surprises no one. Raw pointers are also "more flexible" than smart pointers let alone borrow-checked references.