Table of Contents

Struct SubArray<T>

A struct that helps you use a part of an array.

public readonly struct SubArray<T>

Type Parameters

T

Remarks

Can be reused if you free it by calling Free(SubArray<T>)

Constructors

SubArray(T[])

Creates an instance that will use all the elements of the given array

public SubArray(T[] array)

Parameters

array T[]

SubArray(T[], int)

Creates an instance that will use the first "count" elements of the given array

public SubArray(T[] array, int count)

Parameters

array T[]
count int

Fields

Array

The array where data is stored in. Warning, its length might be bigger than Count.

public readonly T[] Array

Field Value

T[]

Count

The number of elements to be used in that array, counted from the start of the array. Use this instead of Array.Length

public readonly int Count

Field Value

int

Properties

this[int]

Returns the array element at the given index

public T this[int index] { get; set; }

Parameters

index int

Property Value

T

Methods

CopyToArray(ArrayPool<T>)

Returns a new array which length is Count and contains the elements from Array

public T[] CopyToArray(ArrayPool<T> arrayPool)

Parameters

arrayPool ArrayPool<T>

Returns

T[]

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(SubArray<T>)

public bool Equals(SubArray<T> obj)

Parameters

obj SubArray<T>

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Operators

operator ==(SubArray<T>, SubArray<T>)

public static bool operator ==(SubArray<T> a, SubArray<T> b)

Parameters

a SubArray<T>
b SubArray<T>

Returns

bool

operator !=(SubArray<T>, SubArray<T>)

public static bool operator !=(SubArray<T> a, SubArray<T> b)

Parameters

a SubArray<T>
b SubArray<T>

Returns

bool