Feature to get or add value to an associative array.
Nicholas Wilson
iamthewilsonator at hotmail.com
Tue Apr 17 00:45:51 UTC 2018
On Tuesday, 17 April 2018 at 00:04:32 UTC, Cym13 wrote:
> auto value = ptr ? *ptr : *ptr = default;
That is going to crash if ptr is null.
> is a new flag/method really that necessary? In my experience if
> you have trouble naming it you haven't found its true purpose
> yet.
I think `getOrInsert` is a good name for this function
More information about the Digitalmars-d
mailing list