impl FusedIterator

This commit is contained in:
Remco Bloemen 2020-11-19 13:00:28 -08:00 committed by Crozet Sébastien
parent eb3d787ed6
commit d5ca2019a3
1 changed files with 15 additions and 9 deletions

View File

@ -1,5 +1,6 @@
//! Matrix iterators. //! Matrix iterators.
use std::iter::FusedIterator;
use std::marker::PhantomData; use std::marker::PhantomData;
use std::mem; use std::mem;
@ -111,15 +112,6 @@ macro_rules! iterator {
} }
} }
impl<'a, N: Scalar, R: Dim, C: Dim, S: 'a + $Storage<N, R, C>> ExactSizeIterator
for $Name<'a, N, R, C, S>
{
#[inline]
fn len(&self) -> usize {
self.size
}
}
impl<'a, N: Scalar, R: Dim, C: Dim, S: 'a + $Storage<N, R, C>> DoubleEndedIterator impl<'a, N: Scalar, R: Dim, C: Dim, S: 'a + $Storage<N, R, C>> DoubleEndedIterator
for $Name<'a, N, R, C, S> for $Name<'a, N, R, C, S>
{ {
@ -157,6 +149,20 @@ macro_rules! iterator {
} }
} }
} }
impl<'a, N: Scalar, R: Dim, C: Dim, S: 'a + $Storage<N, R, C>> ExactSizeIterator
for $Name<'a, N, R, C, S>
{
#[inline]
fn len(&self) -> usize {
self.size
}
}
impl<'a, N: Scalar, R: Dim, C: Dim, S: 'a + $Storage<N, R, C>> FusedIterator
for $Name<'a, N, R, C, S>
{
}
}; };
} }