|
|
|
|
|
by Georgelemental
869 days ago
|
|
> Aren't 'a and 'b sets of memory a reference can refer to? No, the set of memory the reference refers to is encoded by the reference's bits. Two references with the same lifetime can refer to different memory, and vice-versa. Lifetimes determine when the reference is valid. |
|
Strictly speaking, a pointer points to 1 address, not a set.
Abstractly speaking, a lifetime represents a set of memory that lives a certain length of time, and thus also represents the set of memory a reference with that lifetime can reference.
It's just a different way of thinking about lifetimes which helped me understand them.