Exemplo n.º 1
0
 static ref readonly TSource ElementAt <TSource>(this ReadOnlySpan <TSource> source, int index, int skipCount, int takeCount)
 => ref index < 0 || index >= takeCount?
 ref Throw.ArgumentOutOfRangeExceptionRef <TSource>(nameof(index)) :
     ref source[index + skipCount];
Exemplo n.º 2
0
 public static ref readonly TSource ElementAt <TSource>(this ReadOnlySpan <TSource> source, int index)
 => ref index < 0 || index >= source.Length ?
 ref Throw.ArgumentOutOfRangeExceptionRef <TSource>(nameof(index)) :
 ref source[index];