[Issue 4838] New: Cannot declare a delegate variable for const member functions
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Sep 7 15:38:54 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4838
Summary: Cannot declare a delegate variable for const member
functions
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: major
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: code at klickverbot.at
--- Comment #0 from klickverbot <code at klickverbot.at> 2010-09-07 15:38:30 PDT ---
Given »class A { void foo() const {} }; A a = new A;«,
»typeof(&a.foo).stringof« yields »void delegate() const«.
However, trying to declare a delegate variable of this type like »void
delegate() const dg; dg = &a.foo;« fails with »const/immutable/shared/inout
attributes are only valid for non-static member functions« or, depending on the
scope one tries to declare the variable in, even more cryptic error messages.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list