11 readonly Iterator _iterator;
22 _iterator = iterator ??
throw new ArgumentNullException(nameof(iterator));
28 public T
Current => _position > -1 ? _current! :
throw new InvalidOperationException();
33 object? IEnumerator.Current => _current;
41 if (_iterator.hasNext())
43 _current = (T)_iterator.next();
65 throw new NotSupportedException();