|
|
|
|
|
by steveklabnik
2026 days ago
|
|
There is a weak_ptr equivalent; the borrow checker makes it basically impossible to use references to implement it. You can still do it with raw pointers exactly like you would in C++ too. (And yes, it's a niche data structure, vecs are far more common, but it's people's go-to "the borrow checker restricts you too much" example anyway.) |
|
Seems a counter productive go-to argument given the amount of effort we (c++ coders) generally put in to avoiding non-adjacent memory access :)