On Monday, 4 April 2016 at 11:39:55 UTC, Kagamin wrote:
On Monday, 4 April 2016 at 11:32:23 UTC, Rene Zwanenburg wrote:
https://issues.dlang.org/show_bug.cgi?id=1983
Bug 1983 is about usage of delegates after creation,
restrictions during creation are enforced. AIU, OP wants to
have const ch
On Monday, 4 April 2016 at 11:32:23 UTC, Rene Zwanenburg wrote:
On Monday, 4 April 2016 at 08:10:10 UTC, Edwin van Leeuwen
wrote:
Is there a way to make sure a delegate only reads state,
without changing it? I tried annotating the delegate as const,
but that does not seem to work.
```
Yeah t
On Monday, 4 April 2016 at 11:32:23 UTC, Rene Zwanenburg wrote:
https://issues.dlang.org/show_bug.cgi?id=1983
Bug 1983 is about usage of delegates after creation, restrictions
during creation are enforced. AIU, OP wants to have const check
during creation.
On Monday, 4 April 2016 at 08:10:10 UTC, Edwin van Leeuwen wrote:
Is there a way to make sure a delegate only reads state,
without changing it? I tried annotating the delegate as const,
but that does not seem to work.
```
Yeah this is a nasty old issue. The underlying problem is that a
deleg
On Monday, 4 April 2016 at 08:10:10 UTC, Edwin van Leeuwen wrote:
Is there a way to make sure a delegate only reads state,
without changing it? I tried annotating the delegate as const,
but that does not seem to work.
Note that annotating with pure also doesn't help. As a result we
can have
Is there a way to make sure a delegate only reads state, without
changing it? I tried annotating the delegate as const, but that
does not seem to work.
```D
void main()
{
import std.stdio : writeln;
auto r = [0,1,2,3];
auto f = delegate() const // Compiles even though we are
chang