3 ms·
Yes, you couldn’t do exactly that in Rust, and that’s a good thing. It was a bad design decision. In Rust, the closest thing would probably be a shared Rc memb
by woodruffw 4y ago
Yes, you couldn’t do exactly that in Rust, and that’s a good thing. It was a bad design decision.
In Rust, the closest thing would probably be a shared Rc member for the registry and a non-owning indexing scheme (either weak references or something symbolic). But I’ve never actually seen a Rust codebase that needed to apply the registry pattern; it’s usually the wrong abstraction, like I said.
Edit: And no, replicating this pattern in Rust would not have produced the same failure. The failure mode in C++ resulted in exploitable memory corruption.