2 ms·
I've wondered whether the lifetime elision that happens sometimes on functions could be translated to structs too. So eg. by default all references in a struct
by brundolf 5y ago
I've wondered whether the lifetime elision that happens sometimes on functions could be translated to structs too. So eg. by default all references in a struct are assumed to have the same lifetime, without any annotations. If you need multiple lifetimes or more control, then you add explicit parameters. That would simplify a whole lot of basic uses
Edit: Found some prior discussion here https://users.rust-lang.org/t/why-no-lifetime-elision-for-structs/8216 https://users.rust-lang.org/t/why-no-lifetime-elision-for-st...