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 iter! macro #189

Closed
wants to merge 1 commit into from
Closed

Conversation

malbarbo
Copy link
Contributor

@malbarbo malbarbo commented Jan 23, 2017

A temporary solution for the missing IntoIterator implementation for [T; N] (rust-lang/rust#25725). While I was finishing this PR another issue was opened rust-lang/rust#39257.

When IntoIterator get implemented for [T; N] an user can port their code removing the iter! macro invocations.

My main use case for this is to use the free functions in itertools, like max, with an arbitrary number of elements. The benchmarks show no difference for maxN(a, b, ...) and max(iter!(a, b, ...)).

This introduces a dependency on nodrop.

@bluss
Copy link
Member

bluss commented Jan 23, 2017

Hi, this is of course useful but it's not necessarily for itertools, it's better as its own crate, especially since it involves a series of hacks (It's unfortunate that Rust does not yet support it better, simply!). Previous existing ones solutions were literator and arrayvec, I guess.

@bluss
Copy link
Member

bluss commented Jan 24, 2017

Closing with the motivation in preceding comment.

@bluss bluss closed this Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants