Bewerken

Share via


MemoryMarshal.ToEnumerable<T>(ReadOnlyMemory<T>) Method

Definition

Creates an IEnumerable<T> view of the given read-only memory buffer.

public:
generic <typename T>
 static System::Collections::Generic::IEnumerable<T> ^ ToEnumerable(ReadOnlyMemory<T> memory);
public static System.Collections.Generic.IEnumerable<T> ToEnumerable<T> (ReadOnlyMemory<T> memory);
static member ToEnumerable : ReadOnlyMemory<'T> -> seq<'T>
Public Shared Function ToEnumerable(Of T) (memory As ReadOnlyMemory(Of T)) As IEnumerable(Of T)
Public Shared Iterator Function ToEnumerable(Of T) (memory As ReadOnlyMemory(Of T)) As IEnumerable(Of T)

Type Parameters

T

The type of the items in the read-only memory buffer.

Parameters

memory
ReadOnlyMemory<T>

A read-only memory buffer.

Returns

An enumerable view of memory.

Remarks

This method allows a read-only memory buffer to be used in existing APIs that require a parameter of type IEnumerable<T>.

Applies to