trait ConstLengthIterator<const N: usize> : Iterator {}
impl<T, const N: usize> ConstLengthIterator<N> for std::array::IntoIter<T, N> {}
impl<T, I, F, const N: usize> ConstLengthIterator<N> for std::iter::Map<I, F> where
I : Iterator,
F : FnMut(<I as Iterator>::Item) -> T {}
impl<I1, I2, const N: usize> ConstLengthIterator<N> for std::iter::Zip<I1, I2> where
I1 : ConstLengthIterator<N>,
I2 : ConstLengthIterator<N> {}
Probably could use some additional functions like ways to safely create const length iterators and ways to safely use them to populate arrays, but you get the drift hopefully.
Is this useful? And has it been done, and should I just use a crate someone else has already developed? And if the answer is "yes" to the first question and "no" to the second question, should I create a crate myself and upload it?
I think you'll have far more luck with a ConstLengthIntoIterator, since as Hyeonu mentioned the only constant-length iterators are the infinitely-long ones.
I think you'll also end up hitting a bunch of problems on stable right now, since bounds on const generic values are so restricted.