ReadOnlySpanExtensions.DangerousGetReference<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a reference to the first element within a given ReadOnlySpan<T>, with no bounds checks.
public static ref T DangerousGetReference<T> (this ReadOnlySpan<T> span);
static member DangerousGetReference : ReadOnlySpan<'T> -> 'T
<Extension()>
Public Function DangerousGetReference(Of T) (span As ReadOnlySpan(Of T)) As T
Type Parameters
- T
The type of elements in the input ReadOnlySpan<T> instance.
Parameters
- span
- ReadOnlySpan<T>
The input ReadOnlySpan<T> instance.
Returns
A reference to the first element within span
.
Remarks
This method doesn't do any bounds checks, therefore it is responsibility of the caller to perform checks in case the returned value is dereferenced.