Skip to content
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

Add const-generic IndexedParallelIterator::arrays #974

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Aug 31, 2022

arrays<N>() works like chunks(N) without remainder, and yielding [Item; N] rather than allocated Vec<Item>.

There's no sequential precedent for this yet, but it's proposed in itertools#549. It may also be useful in places that would want Itertools::tuples (#971), because arrays are a first-class alternative to homogeneous tuples.

src/iter/mod.rs Outdated
/// the remaining items are ignored.
///
/// See also [`par_array_chunks()`] and [`par_array_chunks_mut()`] for similar
/// behavior on slices, although they yield array references instead.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reference depends on #789.

@cuviper
Copy link
Member Author

cuviper commented Sep 6, 2022

I missed that the standard library now has an unstable Iterator::array_chunks -- rust-lang/rust#100450.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant