require

Looks up key; if it exists returns corresponding value else evaluates value, adds it to the associative array and returns it.

ref @trusted
static if(__VERSION__ < 2082L)
V
require
(
K
V
)
(
ref V[K] aa
,
K key
,
lazy V value = V.init
)

Parameters

aa V[K]

The associative array.

key K

The key.

value V

The required value.

Return Value

Type: V

The value.

Meta