Beispiel #1
0
        /// <summary>Copies the items in the array to a given destination.</summary>
        /// <param name="destination">The destination span where the items should be copied.</param>
        /// <exception cref="ArgumentOutOfRangeException"><see cref="Length" /> is greater than <paramref name="destination" />.</exception>
        public void CopyTo(UnmanagedSpan <T> destination)
        {
            var items  = _items;
            var length = _length;

            ThrowIfNotInInsertBounds(length, destination.Length, nameof(Length), nameof(destination));

            CopyArrayUnsafe <T>(destination.GetPointerUnsafe(0), items, length);
        }
Beispiel #2
0
        /// <summary>Copies the items in the array to a given destination.</summary>
        /// <param name="destination">The destination span where the items should be copied.</param>
        /// <exception cref="ArgumentOutOfRangeException"><see cref="Length" /> is greater than <paramref name="destination" />.</exception>
        public void CopyTo(UnmanagedSpan <T> destination)
        {
            AssertNotNull(this);

            var items  = &_data->Item;
            var length = _data->Length;

            ThrowIfNotInInsertBounds(length, destination.Length, nameof(Length), nameof(destination));

            CopyArrayUnsafe <T>(destination.GetPointerUnsafe(0), items, length);
        }
Beispiel #3
0
 /// <inheritdoc cref="UnmanagedSpan{T}.CopyTo(UnmanagedSpan{T})" />
 public void CopyTo(UnmanagedSpan <T> destination) => _span.CopyTo(destination);
Beispiel #4
0
 /// <summary>Initializes a new instance of the <see cref="UnmanagedReadOnlySpan{T}" /> struct.</summary>
 /// <param name="span">The underlying span for the readonly span.</param>
 public UnmanagedReadOnlySpan(UnmanagedSpan <T> span)
 {
     _span = span;
 }
Beispiel #5
0
 public DebugView(UnmanagedSpan <T> span)
 {
     _span = span;
 }