Struct Pair<T1, T2>
Represents a pair of values which is represented in memory like an std::Pair from the C++ standard library.
public readonly struct Pair<T1, T2> where T1 : unmanaged where T2 : unmanaged
Type Parameters
T1The type of the first value in the pair.
T2The type of the second value in the pair.
- Inherited Members
Fields
First
The first value in the pair.
public readonly T1 First
Field Value
- T1
Second
The second value in the pair.
public readonly T2 Second
Field Value
- T2
Methods
Deconstruct(out T1, out T2)
Deconstructs the pair into its two values.
public void Deconstruct(out T1 first, out T2 second)
Parameters
firstT1The first value from the pair.
secondT2The second value from the pair.
ToString()
public override string ToString()
Returns
Operators
implicit operator (T1, T2)(Pair<T1, T2>)
Converts a pair to a tuple.
public static implicit operator (T1, T2)(Pair<T1, T2> pair)
Parameters
pairPair<T1, T2>The pair to convert.
Returns
- (T1, T2)
implicit operator Pair<T1, T2>((T1 first, T2 second))
Converts a tuple to a pair.
public static implicit operator Pair<T1, T2>((T1 first, T2 second) tuple)
Parameters
tuple(T1, T2)The tuple to convert.
Returns
- Pair<T1, T2>