-
Notifications
You must be signed in to change notification settings - Fork 506
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
impl IntoParallelIterator for tuples => MultiZip #711
Conversation
This is implemented for tuples up to arity 12, much like the standard library's trait implementations. - For `(a, b, ...)`, it calls `into_par_iter()` on each member. - For `&(a, b, ...)`, it calls `par_iter()` on each member. - For `&mut (a, b, ...)`, it calls `par_iter_mut()` on each member. The resulting `MultiZip` iterator returns a tuple of the zipped items from each input iterator. Internally, it is implemented with macros that forward to a series of regular `zip`s, mapping to a flattened tuple.
My obvious hesitation is that this goes beyond the surface area of libstd. But I think it makes a lot of sense to have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks very good. r=me
bors r+ |
711: impl IntoParallelIterator for tuples => MultiZip r=nikomatsakis a=cuviper This is implemented for tuples up to arity 12, much like the standard library's trait implementations. - For `(a, b, ...)`, it calls `into_par_iter()` on each member. - For `&(a, b, ...)`, it calls `par_iter()` on each member. - For `&mut (a, b, ...)`, it calls `par_iter_mut()` on each member. The resulting `MultiZip` iterator returns a tuple of the zipped items from each input iterator. Internally, it is implemented with macros that forward to a series of regular `zip`s, mapping to a flattened tuple. Closes #567. Co-authored-by: Josh Stone <cuviper@gmail.com>
Build failed |
It seems windows-gnu is broken: rust-lang/rust#67408 |
714: Reduce Windows CI to just stable Rust r=cuviper a=cuviper CI for #711 ran into a broken beta windows-gnu toolchain, which is frustrating, but in general I already feel that it's overkill to test so much on Windows. The Linux builds on Travis CI already test a breadth of compiler versions, and it does so in parallel, whereas Appveyor runs serially. We can just test Windows stable to be sure the platform works at all, and leave it at that. Co-authored-by: Josh Stone <cuviper@gmail.com>
bors retry |
711: impl IntoParallelIterator for tuples => MultiZip r=nikomatsakis a=cuviper This is implemented for tuples up to arity 12, much like the standard library's trait implementations. - For `(a, b, ...)`, it calls `into_par_iter()` on each member. - For `&(a, b, ...)`, it calls `par_iter()` on each member. - For `&mut (a, b, ...)`, it calls `par_iter_mut()` on each member. The resulting `MultiZip` iterator returns a tuple of the zipped items from each input iterator. Internally, it is implemented with macros that forward to a series of regular `zip`s, mapping to a flattened tuple. Closes #567. Co-authored-by: Josh Stone <cuviper@gmail.com>
This is implemented for tuples up to arity 12, much like the standard
library's trait implementations.
(a, b, ...)
, it callsinto_par_iter()
on each member.&(a, b, ...)
, it callspar_iter()
on each member.&mut (a, b, ...)
, it callspar_iter_mut()
on each member.The resulting
MultiZip
iterator returns a tuple of the zipped itemsfrom each input iterator. Internally, it is implemented with macros that
forward to a series of regular
zip
s, mapping to a flattened tuple.Closes #567.