On Friday, 18 April 2014 at 06:35:33 UTC, Walter Bright wrote:
On 4/17/2014 9:23 PM, Brad Anderson wrote:
Would @nogc apply to code being evaluated at compile-time? I
don't think it should.

Yes, it would be. Compile time functions are not special, in fact, there is no such thing in D.

But surely something like:

struct S
{
     this(int d) { data = d; }
     S opBinary(string op)(S rhs) @nogc
     {
       return S(mixin("data "~op~" rhs.data"));
     }

     private int data;
}

Would still work, right? There is no GC activity there.

Reply via email to