Box

constructor(generator: () -> T, value: T? = null)(source)

Parameters

T

the type of the referenced object

generator

generates the referenced object when unaryPlus is invoked for the first time

value

do not assign this field in the constructor; this field is placed in the constructor to ensure Kotlin includes it in the automatically-generated copy method