You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a tracking issue for the methods Iterator::advance_by and DoubleEndedIterator::advance_back_by.
The feature gate for the issue is #![feature(iter_advance_by)].
Previously the recommendation was to implement nth and nth_back on your iterators to efficiently advance them by multiple elements at once (useful for .skip(n) and .step_by(n)). After this feature is stabilized the recommendation will/should be to implement advance_by and advance_back_by instead, because they compose better and are often simpler to implement.
Iterators in libcore that wrap another iterator (possibly from elsewhere than libcore) will need to keep their nth and nth_back implementations for the foreseeable future and perhaps indefinitely, because the inner iterator may have an efficient nth implementation without implementing advance_by as well.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
This is a tracking issue for the methods
Iterator::advance_byandDoubleEndedIterator::advance_back_by.The feature gate for the issue is
#![feature(iter_advance_by)].Previously the recommendation was to implement
nthandnth_backon your iterators to efficiently advance them by multiple elements at once (useful for.skip(n)and.step_by(n)). After this feature is stabilized the recommendation will/should be to implementadvance_byandadvance_back_byinstead, because they compose better and are often simpler to implement.Iterators in libcore that wrap another iterator (possibly from elsewhere than libcore) will need to keep their
nthandnth_backimplementations for the foreseeable future and perhaps indefinitely, because the inner iterator may have an efficientnthimplementation without implementingadvance_byas well.About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
Implementation history
Chain(Implement advance_by, advance_back_by for iter::Chain #77594)slice::{Iter, IterMut}(Implement advance_by, advance_back_by for slice::{Iter, IterMut} #87387, #[inline] slice::Iter::advance_by #87736)vec::IntoIter, ops::Range, iter::{Cycle, Skip, Take, Copied, Flatten}(implement advance_(back_)_by on more iterators #87091)