Span<T>.GetPinnableReference Method

Definition

Returns a reference to the element of the Span<T> at index zero.

public:
 T % GetPinnableReference();
public T GetPinnableReference ();
member this.GetPinnableReference : unit -> 
Public Function GetPinnableReference () As T

Returns

T@

A reference to the element of the Span<T> at index zero, or null if IsEmpty is true.

Remarks

The GetPinnableReference method returns a ref struct. It can be used for pinning a Span<T> in memory. It is required to support the use of a Span<T> within a fixed statement.

Applies to