anonymous functions and scope(exit)

jfondren julian.fondren at gmail.com
Sat Jul 3 17:41:10 UTC 2021


On Saturday, 3 July 2021 at 17:20:47 UTC, Luis wrote:
> This is intentional ?
...
> scope(exit) inside of a anonymous functions, it's never called.

```
$ rdmd --eval 'iota(2).map!((int x) { scope(exit) writeln("got: 
", x); return x+1; }).array.writeln'
got: 0
got: 1
[1, 2]
```

Conclusion: it's not intentional.


More information about the Digitalmars-d-learn mailing list