共用方式為


Vector256.WithElement<T>(Vector256<T>, Int32, T) 方法

定義

建立新的 Vector256<T>,其中指定索引處的項目設為指定值,且其餘項目設定為與指定向量中值的相同值。

public:
generic <typename T>
 where T : value class[System::Runtime::CompilerServices::Extension]
 static System::Runtime::Intrinsics::Vector256<T> WithElement(System::Runtime::Intrinsics::Vector256<T> vector, int index, T value);
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Runtime::Intrinsics::Vector256<T> WithElement(System::Runtime::Intrinsics::Vector256<T> vector, int index, T value);
public static System.Runtime.Intrinsics.Vector256<T> WithElement<T> (this System.Runtime.Intrinsics.Vector256<T> vector, int index, T value) where T : struct;
public static System.Runtime.Intrinsics.Vector256<T> WithElement<T> (this System.Runtime.Intrinsics.Vector256<T> vector, int index, T value);
static member WithElement : System.Runtime.Intrinsics.Vector256<'T (requires 'T : struct)> * int * 'T -> System.Runtime.Intrinsics.Vector256<'T (requires 'T : struct)> (requires 'T : struct)
static member WithElement : System.Runtime.Intrinsics.Vector256<'T> * int * 'T -> System.Runtime.Intrinsics.Vector256<'T>
<Extension()>
Public Function WithElement(Of T As Structure) (vector As Vector256(Of T), index As Integer, value As T) As Vector256(Of T)
<Extension()>
Public Function WithElement(Of T) (vector As Vector256(Of T), index As Integer, value As T) As Vector256(Of T)

類型參數

T

輸入向量的類型。

參數

vector
Vector256<T>

要從其中取得剩餘項目的向量。

index
Int32

要設定之元素的索引。

value
T

要設定元素的值。

傳回

一個向量,其中 index 處的元素值設定為 value,而其餘元素值則設定為與 vector 中的值相同。

例外狀況

不支援 vector (T) 的類型。

index 小於零或大於項目的數目。

適用於