Struct DynamicArray<T>.RangeEnumerable.RangeIterator
IEnumerator-like struct used to iterate through a subsection of this array. See the IEnumerator docs for more info: IEnumerator
Inherited Members
Namespace: UnityEngine.Rendering
Assembly: Unity.RenderPipelines.Core.Runtime.dll
Syntax
public struct DynamicArray<T>.RangeEnumerable.RangeIterator
Remarks
This struct intentionally does not explicitly implement the IEnumarable/IEnumerator interfaces it just follows
the same function signatures. This means the duck typing used by foreach on the compiler level will
pick it up as IEnumarable but at the same time avoids generating Garbage.
For more info, see the C# language specification of the foreach statement.
Constructors
RangeIterator(DynamicArray<T>, int, int)
Create an iterator to iterate over the given range in the array.
Declaration
public RangeIterator(DynamicArray<T> setOwner, int first, int numItems)
Parameters
| Type | Name | Description |
|---|---|---|
| DynamicArray<T> | setOwner | The array to iterate over. |
| int | first | The index of the first item in the array. |
| int | numItems | The number of array members to iterate through. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if the array is null. |
See Also
Properties
Current
Gets the element in the DynamicArray at the current position of the iterator.
Declaration
public ref T Current { get; }
Property Value
| Type | Description |
|---|---|
| T |
See Also
Methods
MoveNext()
Advances the iterator to the next element of the DynamicArray.
Declaration
public bool MoveNext()
Returns
| Type | Description |
|---|---|
| bool | Returs |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The DynamicArray was modified after the iterator was created. |
See Also
Reset()
Sets the iterator to its initial position, which is before the first element in the range.
Declaration
public void Reset()