Re: Anonymous nogc class

2017-09-08 Thread Jiyan via Digitalmars-d-learn
On Friday, 8 September 2017 at 16:10:55 UTC, Biotronic wrote: On Friday, 8 September 2017 at 12:32:35 UTC, Jiyan wrote: [...] It's scoped!T's destructor. If you decide to use that workaround, you should probably copy scoped!T from std.typecons and have your own version. It's not safe in all

Re: Anonymous nogc class

2017-09-08 Thread Biotronic via Digitalmars-d-learn
On Friday, 8 September 2017 at 12:32:35 UTC, Jiyan wrote: On Friday, 8 September 2017 at 06:37:54 UTC, Biotronic wrote: On Thursday, 7 September 2017 at 23:40:11 UTC, Jiyan wrote: [...] Sadly, even std.typecons.scoped isn't currently @nogc: https://issues.dlang.org/show_bug.cgi?id=13972

Re: Anonymous nogc class

2017-09-08 Thread Jiyan via Digitalmars-d-learn
On Friday, 8 September 2017 at 06:37:54 UTC, Biotronic wrote: On Thursday, 7 September 2017 at 23:40:11 UTC, Jiyan wrote: [...] Sadly, even std.typecons.scoped isn't currently @nogc: https://issues.dlang.org/show_bug.cgi?id=13972 https://issues.dlang.org/show_bug.cgi?id=17592 [...] First

Re: Anonymous nogc class

2017-09-08 Thread Biotronic via Digitalmars-d-learn
On Thursday, 7 September 2017 at 23:40:11 UTC, Jiyan wrote: Hey, wanted to know whether it is possible to make anonymous nogc classes: interface I { public void ap(); } void exec(I i) { i.ap; } // now execute, but with something like `scope` exec( new class I { int

Anonymous nogc class

2017-09-07 Thread Jiyan via Digitalmars-d-learn
Hey, wanted to know whether it is possible to make anonymous nogc classes: interface I { public void ap(); } void exec(I i) { i.ap; } // now execute, but with something like `scope` exec( new class I { int tr = 43; override void ap(){tr.writeln;} }); Thanks