On Saturday, 1 September 2018 at 22:38:46 UTC, Ali Çehreli wrote:
You can strip off any attribute with SetFunctionAttributes:
import std.stdio;
// Adapted from std.traits.SetFunctionAttributes documentation
import std.traits;
auto assumeNoGC(T)(T t)
if (isFunctionPointer!T || isDelegate!T)
On Saturday, 1 September 2018 at 21:53:03 UTC, aliak wrote:
Anyway around this?
I don't know if your situation allows it, but you can mark f
explicitly as always @nogc. If your design assumes that it's
@nogc, it's a good idea to add the attribute anyway.
You can also use the C printf functi
You can strip off any attribute with SetFunctionAttributes:
import std.stdio;
// Adapted from std.traits.SetFunctionAttributes documentation
import std.traits;
auto assumeNoGC(T)(T t)
if (isFunctionPointer!T || isDelegate!T)
{
enum attrs = functionAttributes!T | FunctionAttribute.nogc;
I would like to debug a few things and need to insert print
statements to figure things out. I thought that using debug print
would be ok in nogc code?
Seems it make the compiler infer f as not nogc though so this is
basically unworkable unless I go through my entire source code
and remove th