bitvec
bitvec copied to clipboard
Feature Request: `iter_ones_from`
Currently, iter_ones and iter_zeros always begin from the first position (front is set to zero) and there is no easy way to begin iterating at a certain position.
It would be helpful if we could call iter_ones_from(start_index) in order to start iterating the ones from the specified position (note: position in the bitvec, not within the ones). Same for iter_zeros_from of course.
This is somewhat achievable using slices, but requires book-keeping in order to recalculate the absolute indexes from the slice-relative indexes.
If this sounds like a good addition, I'd be glad to try and send a PR.
What would be the difference between bits_full.iter_ones_from(start) and bits_full[start ..].iter_ones()?