Read only delegate
Edwin van Leeuwen via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Apr 4 04:40:06 PDT 2016
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 this is a nasty old issue. The underlying problem is that
> a delegate's function and context pointers are completely
> untyped.
>
> https://issues.dlang.org/show_bug.cgi?id=1983
Thanks for the reference, hopefully this will be resolved at some
point :)
More information about the Digitalmars-d-learn
mailing list