Bug in usage of associative array: dynamic array with string as a key

Ali Çehreli acehreli at yahoo.com
Fri Jun 30 20:32:27 UTC 2023


On 6/30/23 13:16, Cecil Ward wrote:
> On Friday, 30 June 2023 at 19:58:39 UTC, FeepingCreature wrote:

>> Note that you can do `uint ordinal = Decls.ordinals.get(str, -1);`.
> 
> Is the second argument an ‘else’ then, my friend?

Yes, .get and friends appear in this table:

   https://dlang.org/spec/hash-map.html#properties

Ali



More information about the Digitalmars-d-learn mailing list