Re: @nogc closures

2018-08-05 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 5 August 2018 at 12:23:17 UTC, vit wrote: Yes, it isn't possible. I modify filter a and map from std.algorithm: void main()@nogc{ import std.experimental.all; const int j = 2; int i = 0; const int[3] tmp = [1, 2, 3]; tmp[] .xfilter!(

Re: @nogc closures

2018-08-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/5/18 8:23 AM, vit wrote: On Sunday, 5 August 2018 at 10:57:32 UTC, Steven Schveighoffer wrote: On 8/5/18 5:20 AM, vit wrote: It's possible create something like this without errors? void main()@nogc{   //Error: function `app.main` is `@nogc` //  yet allocates closures

Re: @nogc closures

2018-08-05 Thread vit via Digitalmars-d-learn
On Sunday, 5 August 2018 at 10:57:32 UTC, Steven Schveighoffer wrote: On 8/5/18 5:20 AM, vit wrote: It's possible create something like this without errors? void main()@nogc{   //Error: function `app.main` is `@nogc`     //  yet allocates closures with the GC     import std.ex

Re: @nogc closures

2018-08-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/5/18 5:20 AM, vit wrote: It's possible create something like this without errors? void main()@nogc{   //Error: function `app.main` is `@nogc`     //  yet allocates closures with the GC     import std.experimental.all;     const int j = 2;     int i = 0;     const int[3

Re: @nogc closures

2018-08-05 Thread Alex via Digitalmars-d-learn
On Sunday, 5 August 2018 at 09:20:21 UTC, vit wrote: It's possible create something like this without errors? void main()@nogc{ //Error: function `app.main` is `@nogc` // yet allocates closures with the GC import std.experimental.all; const int j = 2; int i =

@nogc closures

2018-08-05 Thread vit via Digitalmars-d-learn
It's possible create something like this without errors? void main()@nogc{ //Error: function `app.main` is `@nogc` // yet allocates closures with the GC import std.experimental.all; const int j = 2; int i = 0; const int[3] tmp = [1, 2, 3]; tmp[]