Associative arrays

Paul Backus snarwin at gmail.com
Tue May 18 13:25:32 UTC 2021


On Tuesday, 18 May 2021 at 09:14:46 UTC, Chris Piker wrote:
> This sounds like a reasonable position.  Imagine for a second 
> that AAs were implemented as a library.  What would the library 
> equivalent of this:
>
> ```d
> long[string] aa = ["foo": 5, "bar": 10, "baz": 2000 ];
> ```
>
> look like?

Something like this, most likely:

```d
auto aa = makeAA!(string, long)("foo", 5, "bar", 10, "baz", 2000);
```


More information about the Digitalmars-d mailing list