@gc attribute for bypassign @nogc

Guillaume Piolat via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 27 13:42:01 PDT 2016


On Sunday, 24 July 2016 at 22:13:02 UTC, bitwise wrote:
>
> There is the following, which is clever. But if it came down to 
> having to do this to bypass @nogc, I simply wouldn't use @nogc.
>
> https://p0nce.github.io/d-idioms/#Bypassing-@nogc
>
> When you have to do it thousands of times throughout your 
> codebase, then yes, it's that bad.
>

FWIW I've removed every use of that bypassing (was used for 
runtime initialization or semaphores locks).
You can also use emplace/destroy like in: 
https://github.com/d-gamedev-team/gfm/blob/master/core/gfm/core/memory.d#L238


More information about the Digitalmars-d mailing list