Class ReadOnlyListEnumerator<T>
A structure similar to ListEnumerator<T>, but for IReadOnlyList<T>. It is not quite as fast as ListEnumerator<T>, but is still faster than using the typical Enumerable implementation for IReadOnlyList. You should only use this if you can't use ListEnumerator<T> due to the type you're working with; they share the same characteristics otherwise.
Namespace: SadRogue.Primitives
Assembly: TheSadRogue.Primitives.dll
Syntax
public sealed class ReadOnlyListEnumerator<T> : ValueType, IEnumerator<T>, IEnumerator, IDisposable, IEnumerable<T>, IEnumerable
Type Parameters
Name | Description |
---|---|
T | Types of elements stored in the list. |
Constructors
ReadOnlyListEnumerator(IReadOnlyList<T>)
Constructor.
Declaration
public ReadOnlyListEnumerator(IReadOnlyList<T> list)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<T> | list | List to iterate over. |
Properties
Current
Declaration
public T Current { get; }
Property Value
Type | Description |
---|---|
T |
Methods
Dispose()
Declaration
public void Dispose()
GetEnumerator()
Returns this enumerator.
Declaration
public ReadOnlyListEnumerator<T> GetEnumerator()
Returns
Type | Description |
---|---|
ReadOnlyListEnumerator<T> | This enumerator. |
MoveNext()
Declaration
public bool MoveNext()
Returns
Type | Description |
---|---|
Boolean |