-
Notifications
You must be signed in to change notification settings - Fork 310
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
Const generics iterator candidates #547
Comments
Note that things like As I understand it |
Could this be added and gated on rust 1.51? That'd maintain backwards compatibility without any problem |
Now that #959 is merged, can we also start to merge other
const-generics
|
Yes! I'm going to try to get some of these merged in the coming weeks. |
Discussed in #546 where I've written an alternative to
tuple_combinations
,array_combinations
which is an iterator that outputs[T; N]
. This feature requires const generics which were introduced in Rust 1.51. It was suggested that we can bump the MSRV in a major release (ie itertools 0.11) but it would be sensible to add more features along side.This crate uses a lot of tuples where arrays make more sense. Tuples are good when you have multiple types (eg cartesian product or zip) but when you have a collection of the same type, a slice/vec/array makes more sense.
Here's a list of functions that seem to qualify using arrays:
These all work on a single iterator over the single
I::Item
type, and since these use tuples, the number of elements is known at compile time, making them perfect for using arrays instead of tuples.The text was updated successfully, but these errors were encountered: