Closed
Description
Something like the following:
trait Iterable<'self, A, T: Iterator<&'self A>> {
fn iter(&'self self) -> T;
}
trait ReverseIterable<'self, A, T: Iterator<&'self A>> {
fn rev_iter(&'self self) -> T;
}
trait MutableIterable<'self, A, T: Iterator<&'self mut A>> {
fn mut_iter(&'self mut self) -> T;
}
trait MutableReverseIterable<'self, A, T: Iterator<&'self mut A>> {
fn mut_rev_iter(&'self mut self) -> T;
}
In the future we can define default methods like enumerate
when method resolve is fixed. #5898