Hello,
Consider this example:
```d
module foo;
import std.stdio;
import std.algorithm;
import std.traits;
import std.range;
void print(R)(R r) {
static assert(isIterable!R);
r.each!writeln;
}
auto construct(R)(R r, ElementType!R delegate(ulong i) fn) {
static assert(isIterable!R && hasAs
On Monday, 23 May 2022 at 13:44:53 UTC, wjoe wrote:
i.construct((ulong i) {return cast(int)(i+i);}).print;
You can actually make this work with `construct!(int[])` rather
than plain `construct`. This is a (really annoying) deficiency in
dmd's implementation. (that sdc solved btw proving it
On Monday, 23 May 2022 at 13:53:02 UTC, Adam D Ruppe wrote:
On Monday, 23 May 2022 at 13:44:53 UTC, wjoe wrote:
[...]
You can actually make this work with `construct!(int[])` rather
than plain `construct`. This is a (really annoying) deficiency
in dmd's implementation. (that sdc solved btw