ArraySectionTGetElementReferenceUnchecked Method

Gets the reference to the element at the specified index, allowing it to point to any element in the UnderlyingArray. To validate index against Length use the GetElementReference method 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 ref T GetElementReferenceUnchecked(
	int index
)

Parameters

index  Int32
The index of the element to get the reference for.

Return Value

T
The reference to the element at the specified index.

Remarks

  Note

This method returns a value by reference. If this library is used by an older compiler that does not support such members, use the GetElementUnchecked/SetElementUnchecked methods instead.

Exceptions

IndexOutOfRangeExceptionindex plus Offset is less than zero or greater or equal to the length of the UnderlyingArray.
VerificationException.NET Framework only: you execute this method in a partially trusted AppDomain that does not allow executing unverifiable code.
NullReferenceExceptionThe IsNull property returns .

See Also