-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking Issue for Iterator::array_chunks
#100450
Comments
It is definitely valuable to have a guaranteed, fixed length in the happy path. It aids vectorization and known-length specialization. It could even help in-place iteration in shapes like |
Might be good to align the naming of this function with
Or
|
I think I'd vote for |
It seems good to follow the same naming conventions as |
I think that the name |
An interesting unresolved question was brought up in #116000, should ArrayChunks::into_remainder return Option? |
I do not see the point of artificially converting an empty slice into a None, which needs to be unwrapped on use. Or semantically, it's not that the remainder is undefined, it just happens to be empty. |
Feature gate:
#![feature(iter_array_chunks)]
This is a tracking issue for
Iterator::array_chunks
, an iterator adapter that allows to group elements of an iterator.Public API
Steps / History
Iterator::array_chunks
(take N+1) #100026Unresolved Questions
DoubleEndedIterator
be implemented?ExactSizeIterator
.rev().array_chunks()
and.array_chunks().rev()
are differentDoubleEndedIterator
implementation should be improvedIterator::next_chunk_back
like there is for forwardunwrap_err_unchecked
innext_back_remainder
sound, despite not usingTrustedLen
? (I didn't block the original PR on this because it goes throughtake
, which I think we can trust, but I'd like someone smarter than me to think about it and confirm.)N != 0
? (See also this same question in[T]::as_chunks
.)array::IntoIter<T, N>
and the current one where the items are[T; N]
and there's a remainder? ([T]::array_chunks
has this question too and is unstable.)Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩
The text was updated successfully, but these errors were encountered: