Citiți în limba engleză Editare

Partajați prin


Vector<T>.TryCopyTo Method

Definition

Overloads

TryCopyTo(Span<Byte>)

Attempts to copy the vector to the given byte span.

TryCopyTo(Span<T>)

Attempts to copy the vector to the given Span<T>.

TryCopyTo(Span<Byte>)

Source:
Vector_1.cs
Source:
Vector_1.cs
Source:
Vector_1.cs

Attempts to copy the vector to the given byte span.

public bool TryCopyTo(Span<byte> destination);
public readonly bool TryCopyTo(Span<byte> destination);

Parameters

destination
Span<Byte>

The destination span to which the values are copied. The destination span must be at least size Count.

Returns

true if the source vector was successfully copied to destination. false if destination is not large enough to hold the source vector.

Exceptions

.NET 5 and later: Type T is not supported.

Applies to

.NET 10 și alte versiuni
Produs Versiuni
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10

TryCopyTo(Span<T>)

Source:
Vector_1.cs
Source:
Vector_1.cs
Source:
Vector_1.cs

Attempts to copy the vector to the given Span<T>.

public bool TryCopyTo(Span<T> destination);
public readonly bool TryCopyTo(Span<T> destination);

Parameters

destination
Span<T>

The destination span to which the values are copied. The destination span must be at least size Count.

Returns

true if the source vector was successfully copied to destination. false if destination is not large enough to hold the source vector.

Exceptions

.NET 5 and later: Type T is not supported.

Applies to

.NET 10 și alte versiuni
Produs Versiuni
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10