示例#1
0
        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);
            }
        }
示例#2
0
 internal Enumerator(NativeSpan <T> span)
 {
     _Span  = span;
     _Index = (nuint)0u;
 }