On Monday, 12 January 2015 at 19:30:10 UTC, Russel Winder via
Digitalmars-d wrote:
On Mon, 2015-01-12 at 10:43 -0800, H. S. Teoh via Digitalmars-d
wrote:
[…]
And what exactly should operator[] return if a key wasn't
found?
[…]
Go has an interesting solution, key lookup in a map return a
pair
(result, ok), if lookup succeeded then result is the associated
value,
if ok is false then result is undefined. I quite like this.
That's basically the same as a pointer to the value. If the
pointer is null, dereferencing it is undefined.