On Tuesday, 19 June 2018 at 21:06:16 UTC, Dennis wrote:
On Tuesday, 19 June 2018 at 19:03:44 UTC, 12345swordy wrote:
Why not use them if given the opportunity based on its context?

You can do that if you want

Although it doesn't seem to work in attribute interference of templates.

```
void main() @nogc {
    example();
}

void example()() {
    int a = 8;
    static if (__traits(compiles, new int(0))) {
        writefln("writeln %d", a);
    } else {
        printf("printf %d", a);
    }
}
```

onlineapp.d(5): Error: @nogc function D main cannot call non-@nogc function onlineapp.example!().example

Maybe there's some workaround?

Reply via email to