ReadOnlySpan<T>.GetPinnableReference Method

Definition

针对类型 T 的对象的只读引用,该对象可用于进行固定,如果要在固定语句中使用范围,也必须使用它。A read-only reference to an object of type T that can be used for pinning, and is required to support the use of span within a fixed statement.

public:
 T& ^ GetPinnableReference();
public ref readonly T GetPinnableReference ();
member this.GetPinnableReference : unit -> 'T
Public Function GetPinnableReference () As T

Returns

T

返回对索引 0 处范围元素的引用;如果范围为空,则为 nullA reference to the element of the span at index 0, or null if the span is empty.

Applies to