[Issue 23319] std.range.Generator does not work with non-mutable elements
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Dec 5 01:37:51 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23319
--- Comment #2 from Ali Cehreli <acehreli at yahoo.com> ---
Thank you for an alternative but it has the same limitation, right?
gen!(() => const(int)(42));
deneme.d(4431): Error: cannot modify `const` expression `this.func`
deneme.d(4448): Error: template instance `deneme.gen!(function () pure nothrow
@nogc @safe => 42)` error instantiating
Line 4431 is this one:
void popFront() { func = fn(); }
Please note that this bug report is about std.range.Generator. No hand-written
code can magically fix it.
--
More information about the Digitalmars-d-bugs
mailing list