Vector128.ToScalar<T>(Vector128<T>) Method

Definition

将给定向量转换为包含第一个元素的值的标量。Converts the given vector to a scalar containing the value of the first element.

public:
generic <typename T>
 where T : value class[System::Runtime::CompilerServices::Extension]
 static T ToScalar(System::Runtime::Intrinsics::Vector128<T> vector);
public static T ToScalar<T> (this System.Runtime.Intrinsics.Vector128<T> vector) where T : struct;
static member ToScalar : System.Runtime.Intrinsics.Vector128<'T (requires 'T : struct)> -> 'T (requires 'T : struct)
<Extension()>
Public Function ToScalar(Of T As Structure) (vector As Vector128(Of T)) As T

Type Parameters

T

输入向量的类型。The type of the input vector.

Parameters

vector
Vector128<T>

要从中获取第一个元素的向量。The vector to get the first element from.

Returns

T

包含第一个元素的值的标量 TA scalar T containing the value of the first element.

Exceptions

不支持 vector 类型 (T)。The type of vector (T) is not supported.

Applies to