public void CopyTo <TOtherSpan>(int sourceStart, ref TOtherSpan targetSpan, int targetStart, int count) where TOtherSpan : ISpan <T> { if (typeof(TOtherSpan) == typeof(Buffer <T>)) { SpanHelper.Copy(ref this, sourceStart, ref Unsafe.As <TOtherSpan, Buffer <T> >(ref targetSpan), targetStart, count); } else if (typeof(TOtherSpan) == typeof(Array <T>)) { SpanHelper.Copy(ref this, sourceStart, ref Unsafe.As <TOtherSpan, Array <T> >(ref targetSpan), targetStart, count); } else { SpanHelper.CopyFallback <T, Buffer <T>, TOtherSpan>(ref this, sourceStart, ref targetSpan, targetStart, count); } }
public void CopyTo(int sourceStart, ref Buffer <T> target, int targetStart, int count) { SpanHelper.Copy(ref this, sourceStart, ref target, targetStart, count); }