3 ms·
> [...] but I don't like how lifetime arguments are mixed with template arguments [...] It does make sense if you think of lifetimes as being part of a type sy
by Measter 4y ago
> [...] but I don't like how lifetime arguments are mixed with template arguments [...]
It does make sense if you think of lifetimes as being part of a type system. Almost all lifetimes are generic (aside from 'static), so it kind of makes sense to put them in the section for declaring generic parameters.
It also works for how you constrain lifetimes: `'foo: 'bar` means that `'foo` outlives `'bar`, but could also be read as `'foo` inherits `'bar` because, like in type inheritance, a `'foo` can be used anywhere that wants a `'bar`.