You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Range is an iterator, copyable when its index is copyable, but not cloneable even if its index is both copyable and cloneable. This interferes with traits like itertools::Product, which require cloneable iterators.
Specifically, this prevents one from doing something like:
iproduct!(0us..10,0us..10).map(|x, y| x*y).all(|z| z >= 0)
which fails with the expected error:
<itertools macros>:2:12:2:37 error: the trait `core::clone::Clone` is not implemented for the type `core::ops::Range<usize>`
<itertools macros>:2{let it = $ crate::Product::new( $ I, $ J); it });(
^~~~~~~~~~~~~~~~~~~~~~~~~
The text was updated successfully, but these errors were encountered:
Range is an iterator, copyable when its index is copyable, but not cloneable even if its index is both copyable and cloneable. This interferes with traits like
itertools::Product
, which require cloneable iterators.Specifically, this prevents one from doing something like:
which fails with the expected error:
The text was updated successfully, but these errors were encountered: