On Wednesday, 20 April 2022 at 10:42:59 UTC, rempas wrote:
I'm trying to create an associative array where the keys will be a "string" type and the values will be function pointers. I'm using a custom type is called "file_struct" and for anyone that wants to try specifically with this type, the definition is the following:

[...]

You need shared static this for initializing immutable AA:

```d
immutable void function(ref file_struct)[string] common_identifiers;

shared static this(){
        common_identifiers = [
      "let"     : &parse_let,
      // "macro"   : &parse_macro,
    ];
}
```

Reply via email to