Span<T>.GetPinnableReference Span<T>.GetPinnableReference Span<T>.GetPinnableReference Span<T>.GetPinnableReference Method

定义

返回对索引为零处 Span<T> 元素的引用。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

返回

返回对索引为零处 Span<T> 元素的引用,或 null,如果 IsEmptytrueA reference to the element of the Span<T> at index zero, or null if IsEmpty is true.

注解

方法返回ref 结构。 GetPinnableReferenceThe GetPinnableReference method returns a ref struct. 它可用于Span<T>在内存中固定。It can be used for pinning a Span<T> in memory. 需要在Span<T> fixed语句中支持的使用。It is required to support the use of a Span<T> within a fixed statement.

适用于