[Issue 9149] Disallow converting delegates to const

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed May 25 12:33:59 PDT 2016


--- Comment #12 from Steven Schveighoffer <schveiguy at yahoo.com> ---
Yes I see.

The issue is the conversion of the delegate type, when the context pointer is
changed to const (but you didn't change the function pointer, so it still
assumes it's argument is mutable).

I agree with you.

So basically, any struct or class instance cannot convert to const (or via pure
constructor to immutable) if it contains a non-const delegate. Yuck, but I
think we have to do that.


More information about the Digitalmars-d-bugs mailing list