to

infix fun <A, B> A.to(that: B): Pair<A, B>(source)

Creates a pair from this value and that, retaining their concrete types.

The receiver becomes the first component and that becomes the second. Values are retained without cloning, including nulls for nullable component types.

val entry = "name" to 42

Receiver

value to store as the first component.

Return

a new pair containing this value and that.

Parameters

that

value to store as the second component.

Type Parameters

A

type of the first component.

B

type of the second component.

See also