Szerkesztés

Megosztás a következőn keresztül:


MemoryExtensions.CopyTo Method

Definition

Overloads

CopyTo<T>(T[], Memory<T>)

Copies the contents of the array into a memory region.

CopyTo<T>(T[], Span<T>)

Copies the contents of the array into the span.

CopyTo<T>(T[], Memory<T>)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Copies the contents of the array into a memory region.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static void CopyTo(cli::array <T> ^ source, Memory<T> destination);
public static void CopyTo<T> (this T[]? source, Memory<T> destination);
public static void CopyTo<T> (this T[] source, Memory<T> destination);
static member CopyTo : 'T[] * Memory<'T> -> unit
<Extension()>
Public Sub CopyTo(Of T) (source As T(), destination As Memory(Of T))

Type Parameters

T

The type of the array.

Parameters

source
T[]

The array to copy items from.

destination
Memory<T>

The memory to copy items into.

Exceptions

The destination is shorter than the source array.

Remarks

If source and destination overlap, this method behaves as if the original values are in a temporary location before the destination is overwritten.

Applies to

CopyTo<T>(T[], Span<T>)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Copies the contents of the array into the span.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static void CopyTo(cli::array <T> ^ source, Span<T> destination);
public static void CopyTo<T> (this T[]? source, Span<T> destination);
public static void CopyTo<T> (this T[] source, Span<T> destination);
static member CopyTo : 'T[] * Span<'T> -> unit
<Extension()>
Public Sub CopyTo(Of T) (source As T(), destination As Span(Of T))

Type Parameters

T

The type of the array.

Parameters

source
T[]

The array to copy items from.

destination
Span<T>

The span to copy items into.

Exceptions

The destination Span is shorter than the source array.

Remarks

If source and destination overlap, this method behaves as if the original values are in a temporary location before the destination is overwritten.

Applies to