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 indexer instead.
public ref T GetElementReference(
int index
)
Public Function GetElementReference (
index As Integer
) As T
public:
T% GetElementReference(
int index
)
member GetElementReference :
index : int -> 'T
This method validates index against Length. To allow returning a reference to any element from the UnderlyingArray (allowing even a negative index if Offset is nonzero), then use the GetElementReferenceUnchecked method instead.
IndexOutOfRangeException | index is less than zero or greater or equal to Length. |
VerificationException | .NET Framework only: you execute this method in a partially trusted AppDomain that does not allow executing unverifiable code. |