▲ | int_19h 7 months ago | ||||||||||||||||||||||
In Rust, the de facto standard advice for such cases seems to be, "just use indices into an array instead of references". While this is sometimes done in C++ as well for various reasons, it's certainly not the default pattern there. If you have two things that need to point to each other, you just do that. | |||||||||||||||||||||||
▲ | empath75 7 months ago | parent [-] | ||||||||||||||||||||||
> While this is sometimes done in C++ as well for various reasons, it's certainly not the default pattern there. If you have two things that need to point to each other, you just do that. And then you have to handle all the subtle memory bugs that you've introduced by doing that. | |||||||||||||||||||||||
|