I'm trying to require a generic type to be indexable by const ref to another generic:
struct A<T, I> where T: Index<&I> {
t: T,
some_more_uses_of_I...
}
it does not compile asking me to provide a lifetime for &I. When I change it into &'_ I
compiler complains that "'_
cannot be used here" and "'_
is a reserved lifetime name". How can I make it work? To my understanding there is no real need for the lifetime, the reference must be alive only during execution of []
and I belive I shouldn't tie it to any other object.