Could anyone tell why? Thank you.
import std.algorithm; void main(string[] args) { int[] arr = [1, 2, 3, 4, 5]; arr.each!((ref e) => { writeln(e); // does not print ++e; })(); writeln(arr); // prints [1, 2, 3, 4, 5] }
ref2401 via Digitalmars-d-learn Mon, 30 Nov 2015 01:56:59 -0800
Could anyone tell why? Thank you.
import std.algorithm; void main(string[] args) { int[] arr = [1, 2, 3, 4, 5]; arr.each!((ref e) => { writeln(e); // does not print ++e; })(); writeln(arr); // prints [1, 2, 3, 4, 5] }