2 ms·
It is a reference, yes, and without optimization, is a pointer to a value. Your parent is suggesting to not think of it in such a low-level way, and instead th
by steveklabnik 7y ago
It is a reference, yes, and without optimization, is a pointer to a value.
Your parent is suggesting to not think of it in such a low-level way, and instead think of it as a permission. In this case, the pointer being optimized away makes more sense, as it’s not really about it being a pointer.
I’m of two minds about it, to be honest.
- cormacrelf 7y agoIf you had a Range<BigNum> then it would make a lot of sense. I can’t remember if Range<T>’s constraints on T would support that, though.
- eridius 7y agoAFAIK the only constraint on `Range::contains` is that the `Idx` type conforms to `PartialOrd`. So you could in fact have a `Range<String>` if you so desired.
- wiggler00m 7y agoThanks for the book! A++ would read again. https://www.amazon.com/Rust-Programming-Language-Steve-Klabnik/dp/1593278284 https://www.amazon.com/Rust-Programming-Language-Steve-Klabn...
- steveklabnik 7y agoYou're welcome!