Method GetReference
GetReference<T>(ExSpan<T>)
Returns a reference to the 0th element of the ExSpan. Such a reference may or may not be null. It can be used for pinning but must never be dereferenced (返回 ExSpan 中索引为 0 处元素的引用. 这样的引用可能为空, 也可能不为空. 它可以用于固定, 但绝不能解引用).
public static ref T GetReference<T>(ExSpan<T> span)
Parameters
span
ExSpan<T>The source span (源跨度).
Returns
- T
a reference to the 0th element of the ExSpan (ExSpan 中索引为 0 处元素的引用).
Type Parameters
T
The element type (元素的类型).
GetReference<T>(ReadOnlyExSpan<T>)
Returns a reference to the 0th element of the ReadOnlyExSpan. Such a reference may or may not be null. It can be used for pinning but must never be dereferenced (返回 ReadOnlyExSpan 中索引为 0 处元素的引用. 这样的引用可能为空, 也可能不为空. 它可以用于固定, 但绝不能解引用).
public static ref T GetReference<T>(ReadOnlyExSpan<T> span)
Parameters
span
ReadOnlyExSpan<T>The source span (源跨度).
Returns
- T
a reference to the 0th element of the ReadOnlyExSpan (ReadOnlyExSpan 中索引为 0 处元素的引用).
Type Parameters
T
The element type (元素的类型).