getValue

inline operator fun <V> WeakMap<String, V>.getValue(thisRef: Any?, property: KProperty<*>): V?(source)

Allows to use a weak map for data-oriented usage.

Example

val map = WeakMap<String, Int>()

var score by map
var age by map

score = 5
println(age)

See also

Equivalent method for regular maps.