4 ms·
> C++ references do not help you with use-after-free, accidental concurrent modification or container/iterator invalidation. Maybe I didn't express this clearl
by cyber_kinetist 4y ago
> C++ references do not help you with use-after-free, accidental concurrent modification or container/iterator invalidation.
Maybe I didn't express this clearly enough, but I don't use C++ pointers or references to store something that is more than just temporary, I usually go for indices instead. You should read the "Handles are the better pointers" article (https://floooh.github.io/2018/06/17/handles-vs-pointers.html https://floooh.github.io/2018/06/17/handles-vs-pointers.html) to understand a bit more of what I'm saying.
> with C++ still lacking concepts it's really no match.
I thought C++ already had concepts in C++20? (Though I honestly haven't got that much use for it, and I still use C++17 since I want to wait a bit until compiler implementations get mature).
> Rust's tooling blows C++ out of the water.
Agree with Rust's toolings being more polished than its C++ counterparts. I like that Rust has Cargo and also its own build.rs which you can code your custom build scripts in the same language. I also agree that Rust modules are much better than C++ headers (although modules are in C++20, I feel it's already a bit too late when so much existing code hasn't been written for it) The last time I looked at IDE support with Rust it wasn't that great, but that was quite some years ago so things might have changed a lot.