After being very happy about associative arrays of D Language, I encountered that they are not `@nogc`friendly. Unsure if I should wait for D language to support it, or do I need to rethink everything.

Error
```
onlineapp.d(20): Error: assigning an associative array element in `@nogc` function `D main` may cause a GC allocation
```

Source Code
```
import std;

void outofcontext() @nogc @system
{
    printf("Hello D ", associative);
    foreach (pointeraddress, information; associative){
                
       printf("%i", *cast(int *)pointeraddress);
    }

}

static string[void*] associative;

void main() @nogc @system
{
    printf("Hello D ", associative);

    int variable = 6;
    associative[&variable] = "someinformation";

    outofcontext();
}

```

Reply via email to