What is the preferred method for testing the existence of a key in an associative array?
Well, I usually do it as:
int[string] someCache;
int getValue(string key)
{
if (auto val = key in someCache)
return *val;
return someCache[key] = -3;
}
