-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Tracking Issue for feature(iter_advance_by) #77404
Copy link
Copy link
Open
Labels
A-iteratorsArea: IteratorsArea: IteratorsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-iteratorsArea: IteratorsArea: IteratorsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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)