Is there anyway to make opApply @nogc?

Gary Willoughby via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 22 10:16:40 PDT 2016


On Wednesday, 22 June 2016 at 13:36:54 UTC, Marc Schütz wrote:
> On Tuesday, 21 June 2016 at 19:21:01 UTC, Gary Willoughby wrote:
>> Right ok, thanks! It doesn't seem to help though as the 
>> compiler complains about it being not @nogc.
>
> You probably need to declare the delegate and opApply() itself 
> as @nogc, too:
>
> int opApply(scope int delegate(int) @nogc dg) @nogc { }

That fixed it, thanks all for your help. :)


More information about the Digitalmars-d-learn mailing list