Читати англійською Редагувати

Поділитися через


ReadOnlyMemory<T>.Implicit Operator

Definition

Overloads

Implicit(ArraySegment<T> to ReadOnlyMemory<T>)

Defines an implicit conversion of a ArraySegment<T> to a ReadOnlyMemory<T>.

Implicit(T[] to ReadOnlyMemory<T>)

Defines an implicit conversion of an array to a ReadOnlyMemory<T>.

Implicit(ArraySegment<T> to ReadOnlyMemory<T>)

Source:
ReadOnlyMemory.cs
Source:
ReadOnlyMemory.cs
Source:
ReadOnlyMemory.cs

Defines an implicit conversion of a ArraySegment<T> to a ReadOnlyMemory<T>.

C#
public static implicit operator ReadOnlyMemory<T>(ArraySegment<T> segment);

Parameters

segment
ArraySegment<T>

The array segment to convert.

Returns

A read-only memory representation of the array segment.

Applies to

.NET 10 та інші версії
Продукт Версії
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided), 2.1

Implicit(T[] to ReadOnlyMemory<T>)

Source:
ReadOnlyMemory.cs
Source:
ReadOnlyMemory.cs
Source:
ReadOnlyMemory.cs

Defines an implicit conversion of an array to a ReadOnlyMemory<T>.

C#
public static implicit operator ReadOnlyMemory<T>(T[]? array);
C#
public static implicit operator ReadOnlyMemory<T>(T[] array);

Parameters

array
T[]

An array of type T to convert.

Returns

The read-only memory representation of the array of type T.

Applies to

.NET 10 та інші версії
Продукт Версії
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided), 2.1