These guidelines pretty much apply to C++, although pointers in Rust are more akin to smart pointers than raw pointers, and there are indeed a bunch of use cases for those. Sticking to values and references works pretty well most of the time though.
But pointers in Rust seem pretty well thought out and more sophisticated than what's possible in C++. I'm particularly excited about the compiler error when a borrowed pointer goes out of scope.
But pointers in Rust seem pretty well thought out and more sophisticated than what's possible in C++. I'm particularly excited about the compiler error when a borrowed pointer goes out of scope.