ValueTuple<T1,T2,T3,T4,T5,T6,T7,TRest>(T1, T2, T3, T4, T5, T6, T7, TRest) 建構函式

定義

初始化新的 ValueTuple<T1,T2,T3,T4,T5,T6,T7,TRest> 執行個體。Initializes a new ValueTuple<T1,T2,T3,T4,T5,T6,T7,TRest> instance.

public:
 ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest);
public ValueTuple (T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest);
new ValueTuple<'T1, 'T2, 'T3, 'T4, 'T5, 'T6, 'T7, 'Rest (requires 'Rest : struct)> : 'T1 * 'T2 * 'T3 * 'T4 * 'T5 * 'T6 * 'T7 * 'Rest -> ValueTuple<'T1, 'T2, 'T3, 'T4, 'T5, 'T6, 'T7, 'Rest (requires 'Rest : struct)>
Public Sub New (item1 As T1, item2 As T2, item3 As T3, item4 As T4, item5 As T5, item6 As T6, item7 As T7, rest As TRest)

參數

item1
T1

值元組的第一個元素。The value tuple's first element.

item2
T2

值元組的第二個元素。The value tuple's second element.

item3
T3

值元組的第三個元素。The value tuple's third element.

item4
T4

值元組的第四個元素。The value tuple's fourth element.

item5
T5

值元組的第五個元素。The value tuple's fifth element.

item6
T6

值元組的第六個元素。The value tuple's sixth element.

item7
T7

值元組的第七個元素。The value tuple's seventh element.

rest
TRest

任何值元組類型的執行個體,包含值元組剩餘元素的值。An instance of any value tuple type that contains the values of the value's tuple's remaining elements.

例外狀況

rest 不是泛型值元組類型。rest is not a generic value tuple type.

備註

除了使用您語言的元組內建支援,您也可以藉由呼叫靜態 ValueTuple.Create<T1,T2,T3,T4,T5,T6,T7,T8>(T1, T2, T3, T4, T5, T6, T7, T8) 方法來建立值元組,而不需要明確指定其元素的類型。In addition to using your language's build-in support for tuples, you can also create a value tuple by calling the static ValueTuple.Create<T1,T2,T3,T4,T5,T6,T7,T8>(T1, T2, T3, T4, T5, T6, T7, T8) method without having to explicitly specify the types of its elements.

適用於

另請參閱