Thread overview | |||||
---|---|---|---|---|---|
|
August 11, 2016 How to add nogc to delegate | ||||
---|---|---|---|---|
| ||||
void foo(@nogc void delegate()) doesn't work. But declaring an alias does, but too verbose. Surely we should be able to add the attribute directly? |
August 11, 2016 Re: How to add nogc to delegate | ||||
---|---|---|---|---|
| ||||
Posted in reply to Engine Machine | On 08/11/2016 06:15 AM, Engine Machine wrote:
> void foo(@nogc void delegate())
>
> doesn't work.
Put it after the parameter list, like so:
void foo(void delegate() @nogc)
|
August 11, 2016 Re: How to add nogc to delegate | ||||
---|---|---|---|---|
| ||||
Posted in reply to ag0aep6g | On Thursday, 11 August 2016 at 05:12:39 UTC, ag0aep6g wrote: > On 08/11/2016 06:15 AM, Engine Machine wrote: >> void foo(@nogc void delegate()) >> >> doesn't work. > > Put it after the parameter list, like so: > > void foo(void delegate() @nogc) You may also need to add the scope keyword too. Reference: http://forum.dlang.org/thread/zaxaqgeeenwypmijrfdl@forum.dlang.org |
Copyright © 1999-2021 by the D Language Foundation