[Issue 8114] Methods are delegates, not functions.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 20 06:44:20 PDT 2012


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



--- Comment #16 from Stewart Gordon <smjg at iname.com> 2012-05-20 06:45:56 PDT ---
(In reply to comment #15)
> It depends on what you mean by "pointer to member".

If it means there are no pointer-to-member _types_ in D, then that's what it
should say.

> If you say a VARIABLE is a pointer to a member, then yes, it doesn't have to
> have a distinct type.
> 
> If you say a TYPE is a pointer to a member, then (by definition), it is a
> distinct type. (Otherwise, how do you distinguish between a type that is a
> pointer-to-member vs. one that isn't?)

You wouldn't.  They'd be one and the same type.  I don't see any reason for
them to be distinguished.

If OTOH you implement a pointer-to-member as an index into the vtbl, so that it
calls the correct method implementation for the object's subclass, _then_ you
need a distinct type for it.

-- 
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