Open
Description
Feature gate: #![feature(iter_next_chunk)]
This is a tracking issue for the .next_chunk()
method on iterators which allows you to advance the iterator N
elements and return an array [T; N]
Public API
use core::array;
trait Iterator {
type Item;
fn next_chunk<const N: usize>(&mut self,) -> Result<[Self::Item; N], array::IntoIter<Self::Item, N>>
where
Self: Sized;
}
Steps / History
- Implementation:
- Final comment period (FCP)
- Stabilization PR
Unresolved Questions
- Naming: other options include
next_array()
ornext_array_chunk()
. - Should we also add
next_chunk_back
toDoubleEndedIterator
? - How should we handle
N = 0
?