public void CopyTo(NativeSpan <T> destination) { if (destination._Pointer == _Pointer) { // there's no point copying inside itself return; } if (destination.Length > Length) { ThrowHelper.ThrowDestinationTooShort(); } else { nuint length = destination.Length * (nuint)sizeof(T); Buffer.MemoryCopy(_Pointer, destination._Pointer, length, length); } }
internal Enumerator(NativeSpan <T> span) { _Span = span; _Index = (nuint)0u; }