Insert if doesn't exist without double lookup.

Agustin wolftein1 at gmail.com
Sat Mar 15 11:44:46 PDT 2014


Hello!, i would like to know if this is possible.

auto asValue ?= (map["Key"] == new Value);

Instead of doing:

if (("Key" in map) is null)
    map["Key"] = new Value
auto asValue = map["Key"];


More information about the Digitalmars-d-learn mailing list