[Issue 2557] inconsistent behavior when taking reference to member without instance

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 12 01:09:55 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2557





------- Comment #6 from smjg at iname.com  2009-01-12 03:09 -------
(In reply to comment #5)
> That's a feature! Even if method is not static, it still has a single unique
> body. If so, why can't you take its address?

http://www.digitalmars.com/d/1.0/type.html#delegates
"There are no pointers-to-members in D, but a more useful concept called
delegates are supported."

Even if there were, the type would not be
    void function()
as is declared in the attached code, but rather
    void function(A)
or perhaps something like
    void A.function()
akin to C++ notation (IIRC)
    void (A::*)()

Maybe
    void function()
would work if the calling convention specifies that the context pointer be
always passed in a register that is never used for any other kind of function
argument, but that isn't the case in the current ABI.


-- 



More information about the Digitalmars-d-bugs mailing list