Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
struct System.​ValueTuple
Assembly: System.Runtime
Implemented Interfaces
Provides static methods for creating value tuples.
Methods
public
int
CompareTo​(ValueTuple other)
Compares the current <see cref="T:System.ValueTuple" /> instance to a specified <see cref="T:System.ValueTuple" /> instance.
Returns This method always returns 0.
other
The object to compare with the current instance.
Returns A new value tuple with no components.
public static
ValueTuple<​T1>
Create​(T1 item1)
Creates a new value tuple with 1 component (a singleton).
Returns A value tuple with 1 component.
item1
The value of the value tuple's only component.
public static
ValueTuple<​T1, T2>
Create​(T1 item1,
T2 item2)
Creates a new value tuple with 2 components (a pair).
Returns A value tuple with 2 components.
item1
The value of the value tuple's first component.
item2
The value of the value tuple's second component.
public static
ValueTuple<​T1, T2, T3>
Create​(T1 item1,
T2 item2,
T3 item3)
Creates a new value tuple with 3 components (a triple).
Returns A value tuple with 3 components.
item1
The value of the value tuple's first component.
item2
The value of the value tuple's second component.
item3
The value of the value tuple's third component.
public static
ValueTuple<​T1, T2, T3, T4>
Create​(T1 item1,
T2 item2,
T3 item3,
T4 item4)
Creates a new value tuple with 4 components (a quadruple).
Returns A value tuple with 4 components.
item1
The value of the value tuple's first component.
item2
The value of the value tuple's second component.
item3
The value of the value tuple's third component.
item4
The value of the value tuple's fourth component.
public static
ValueTuple<​T1, T2, T3, T4, T5>
Create​(T1 item1,
T2 item2,
T3 item3,
T4 item4,
T5 item5)
Creates a new value tuple with 5 components (a quintuple).
Returns A value tuple with 5 components.
item1
The value of the value tuple's first component.
item2
The value of the value tuple's second component.
item3
The value of the value tuple's third component.
item4
The value of the value tuple's fourth component.
item5
The value of the value tuple's fifth component.
public static
ValueTuple<​T1, T2, T3, T4, T5, T6>
Create​(T1 item1,
T2 item2,
T3 item3,
T4 item4,
T5 item5,
T6 item6)
Creates a new value tuple with 6 components (a sexuple).
Returns A value tuple with 6 components.
item1
The value of the value tuple's first component.
item2
The value of the value tuple's second component.
item3
The value of the value tuple's third component.
item4
The value of the value tuple's fourth component.
item5
The value of the value tuple's fifth component.
item6
The value of the value tuple's sixth component.
public static
ValueTuple<​T1, T2, T3, T4, T5, T6, T7>
Create​(T1 item1,
T2 item2,
T3 item3,
T4 item4,
T5 item5,
T6 item6,
T7 item7)
Creates a new value tuple with 7 components (a septuple).
Returns A value tuple with 7 components.
item1
The value of the value tuple's first component.
item2
The value of the value tuple's second component.
item3
The value of the value tuple's third component.
item4
The value of the value tuple's fourth component.
item5
The value of the value tuple's fifth component.
item6
The value of the value tuple's sixth component.
item7
The value of the value tuple's seventh component.
public static
ValueTuple<​T1, T2, T3, T4, T5, T6, T7, ValueTuple<​T8>>
Create​(T1 item1,
T2 item2,
T3 item3,
T4 item4,
T5 item5,
T6 item6,
T7 item7,
T8 item8)
Creates a new value tuple with 8 components (an octuple).
Returns A value tuple with 8 components.
item1
The value of the value tuple's first component.
item2
The value of the value tuple's second component.
item3
The value of the value tuple's third component.
item4
The value of the value tuple's fourth component.
item5
The value of the value tuple's fifth component.
item6
The value of the value tuple's sixth component.
item7
The value of the value tuple's seventh component.
item8
The value of the value tuple's eighth component.
public
bool
Equals​(object obj)
Returns a value that indicates whether the current <see cref="T:System.ValueTuple" /> instance is equal to a specified object.
Returns <see langword="true" /> if <paramref name="obj" /> is a <see cref="T:System.ValueTuple" /> instance; otherwise, <see langword="false" /> .
obj
The object to compare to the current instance.
public
bool
Equals​(ValueTuple other)
Determines whether two <see cref="T:System.ValueTuple" /> instances are equal. This method always returns <see langword="true" /> .
Returns This method always returns <see langword="true" /> .
other
The value tuple to compare with the current instance.
public
int
GetHashCode​()
Returns the hash code for the current <see cref="T:System.ValueTuple" /> instance.
Returns This method always return 0.
public
string
ToString​()
Returns the string representation of this <see cref="T:System.ValueTuple" /> instance.
Returns This method always returns "()".
protected
void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public
Type
GetType​()
Inherited from object
Gets the <see cref="T:System.Type" /> of the current instance.
Returns The exact runtime type of the current instance.
protected
object
MemberwiseClone​()
Inherited from object
Creates a shallow copy of the current <see cref="T:System.Object" /> .
Returns A shallow copy of the current <see cref="T:System.Object" /> .