[Issue 1983] Delegates violate const

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 30 11:30:43 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=1983

Simen Kjaeraas <simen.kjaras at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simen.kjaras at gmail.com

--- Comment #22 from Simen Kjaeraas <simen.kjaras at gmail.com> ---
(In reply to anonymous4 from comment #21)
> void f(void delegate() const a);
> unittest
> {
>     A a;
>     f(&a.g);
> }

Sadly, this also disallows a large set of valid use cases, the simplest of
which is f((){}).

If (){} yielded a void delegate() const, this would not be a problem.

--


More information about the Digitalmars-d-bugs mailing list