On 05/21/2016 04:39 PM, pineapple wrote:
But I don't understand why. Could someone clarify the difference between
the two?
Common mistake, because other languages (e.g. C#) use similar but
different syntax.
The `foo => bar` syntax doesn't use braces. When you add braces around
bar, that's
On Saturday, 21 May 2016 at 14:39:59 UTC, pineapple wrote:
void clean(in void delegate(in T value) func){
this.clean((in T values[]) => {
foreach(value; values) func(value);
});
This doesn't do what you think it does. It passes a lambda that
*returns* that
I wrote a pair of methods that looked like this:
void clean(in void delegate(in T value) func){
this.clean((in T values[]) => {
foreach(value; values) func(value);
});
}
void clean(in void delegate(in T values[]) func){
...
}
I was getting a