Memory<T> Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Memory<T>(T[]) |
Creates a new Memory<T> object over the entirety of a specified array. |
Memory<T>(T[], Int32, Int32) |
Creates a new Memory<T> object that includes a specified number of elements of an array beginning at a specified index. |
Memory<T>(T[])
- Source:
- Memory.cs
- Source:
- Memory.cs
- Source:
- Memory.cs
Creates a new Memory<T> object over the entirety of a specified array.
public:
Memory(cli::array <T> ^ array);
public Memory (T[]? array);
public Memory (T[] array);
new Memory<'T> : 'T[] -> Memory<'T>
Public Sub New (array As T())
Parameters
- array
- T[]
The array from which to create the Memory<T> object.
Exceptions
Remarks
If array
is null
, this constructor returns a Memory<T> object with a default<T>
value.
Applies to
Memory<T>(T[], Int32, Int32)
- Source:
- Memory.cs
- Source:
- Memory.cs
- Source:
- Memory.cs
Creates a new Memory<T> object that includes a specified number of elements of an array beginning at a specified index.
public:
Memory(cli::array <T> ^ array, int start, int length);
public Memory (T[]? array, int start, int length);
public Memory (T[] array, int start, int length);
new Memory<'T> : 'T[] * int * int -> Memory<'T>
Public Sub New (array As T(), start As Integer, length As Integer)
Parameters
- array
- T[]
The source array.
Exceptions
array
is null
, but start
or length
is non-zero.
-or-
start
is outside the bounds of the array.
-or-
start
and length
exceeds the number of elements in the array.
T
is a reference type, and array
is not an array of type T
.
Remarks
If array
is null
, this constructor returns a Memory<T> object with a default<T>
value.
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應