Replace

stdtraits~ Replace

Source:

Swap out one value in a con­tainer for an­other.

This trait is im­pli­citly im­ple­men­ted if the con­tainer im­ple­ments Get and Set, so you usu­ally do not need to manu­ally im­ple­ment this.

In­ter­face

(c: Con­tainer, v: Value, k: Key) => r: Value.

Ver­sion his­tory

  • 1.2.0 Sup­port for ob­jects with Sym­bol keys.