ArraySectionTGetElementUnchecked Method

Gets the element at the specified index, allowing it to point to any element in the UnderlyingArray. To validate index against Length use the indexer instead. This method does not perform any validation, so it can even throw a NullReferenceException if the IsNull property returns .

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public T GetElementUnchecked(
	int index
)

Parameters

index  Int32
The index of the element to get.

Return Value

T
The element at the specified index.

Remarks

If the compiler you use supports members that return a value by reference, you can also use the GetElementReferenceUnchecked method.

Exceptions

IndexOutOfRangeExceptionindex plus Offset is less than zero or greater or equal to the length of the UnderlyingArray.
NullReferenceExceptionThe IsNull property returns .

See Also