y
Size: a a a
y
ВE
y
ML
y
ML
y
y
y
ML
public class NormalIterator<T> : IEnumerator<T>
{
private T[] vs;
private int length;
private int index = -1; // Текущий индекс
public T Current { get; private set; } // Текущий элемент
public NormalIterator(T[] vs) // Инициализация итератора через массив
{
this.vs = vs;
length = vs.Length;
}
public bool MoveNext() // Переход к следующему
{
index++;
Current = vs[index];
return index < length; // Если в коллецкии закончились элементы, то false
}
}
ML
y
y
ML
y
ML
y
ML