Closed
Description
Currently enumerate
uses usize
for counting. This is necessary when iterating over slices (probably the most common scenario). However, in general an iterator is not necessarily related to memory, so it may make more sense to use other integer types.
It seems sensible to make enumerate
generic over the integer type used for counting. This is backwards compatible, so it shouldn't break existing code.
pub struct Enumerate<I, T: Int> {
iter: I,
count: T
}
Would it be possible to make this change although enumerate
is marked as stable?