On Tuesday, 30 August 2016 at 08:18:47 UTC, Johannes Pfau wrote:
There are some nice use cases for this:
* Do not enforce @nogc for CTFE only functions, so you can mark
complete module nogc: and CTFE only functions will get ignored
* Do not emit code for CTFE only functions. This is useful for
metal programming: The CTFE only function can depend on
functions not available in the bare metal runtime.
These are common problems when using string mixins: The
to generate the mixed in code use string manipulation which is
not @nogc and might require runtime functions. But the code
function is exclusively used in CTFE.
I do not see how this could affect @nogc.
But yes you can circumvent the code-generation and pulling in the
druntime dependency using a static if.