ReadOnlyMemory<T> 建構函式

定義

多載

ReadOnlyMemory<T>(T[])

在整個目標陣列上建立新記憶體區域。

ReadOnlyMemory<T>(T[], Int32, Int32)

在起始於指定位置且包含指定元素數的目標陣列部分上建立新記憶體區域。

ReadOnlyMemory<T>(T[])

來源:
ReadOnlyMemory.cs
來源:
ReadOnlyMemory.cs
來源:
ReadOnlyMemory.cs

在整個目標陣列上建立新記憶體區域。

public:
 ReadOnlyMemory(cli::array <T> ^ array);
public ReadOnlyMemory (T[]? array);
public ReadOnlyMemory (T[] array);
new ReadOnlyMemory<'T> : 'T[] -> ReadOnlyMemory<'T>
Public Sub New (array As T())

參數

array
T[]

目標陣列。

例外狀況

array 是 Covariant,且陣列的類型不完全是 T[]

備註

當 為 nullarraydefault 回 。

適用於

ReadOnlyMemory<T>(T[], Int32, Int32)

來源:
ReadOnlyMemory.cs
來源:
ReadOnlyMemory.cs
來源:
ReadOnlyMemory.cs

在起始於指定位置且包含指定元素數的目標陣列部分上建立新記憶體區域。

public:
 ReadOnlyMemory(cli::array <T> ^ array, int start, int length);
public ReadOnlyMemory (T[]? array, int start, int length);
public ReadOnlyMemory (T[] array, int start, int length);
new ReadOnlyMemory<'T> : 'T[] * int * int -> ReadOnlyMemory<'T>
Public Sub New (array As T(), start As Integer, length As Integer)

參數

array
T[]

目標陣列。

start
Int32

要開始記憶體區域的索引。

length
Int32

記憶體區域中的項目數。

例外狀況

array 是 Covariant,且陣列的類型不完全是 T[]

startlengthstart + length 識別陣列範圍之外的位置。

備註

當 為 nullarraydefault 回 。

適用於