Method SubRange
SubRange(int, int)
Returns an IEnumeralbe-Like object that iterates through a subsection of this array.
Declaration
public DynamicArray<T>.RangeEnumerable SubRange(int first, int numItems)
Parameters
Type | Name | Description |
---|---|---|
int | first | The index of the first item |
int | numItems | The number of items to iterate |
Returns
Type | Description |
---|---|
DynamicArray<T>.RangeEnumerable |
|
Remarks
The returned 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 IEnumerable but at the same time avoids generating Garbage.
For more info, see the C# language specification of the foreach
statement.