Pointers to non-static member functions!

Daniel Murphy yebblies at nospamgmail.com
Wed Jun 8 11:27:36 PDT 2011


"Michel Fortin" <michel.fortin at michelf.com> wrote in message 
news:isoa8d$nif$1 at digitalmars.com...
>
> True. What I mean is that a function type should know whether it needs a 
> 'this' pointer or not, and implicit conversion between a function type 
> that needs a this pointer and one that doesn't need one should be 
> forbidden. And calling such a function directly would either not work, or 
> would require a 'this' to be provided as the first argument (which is then 
> put at the right place according to the ABI rules).
>

Ah I see.  This could probably be implemented quite easily, but I doubt it's 
worth the effort.  I think most cases can be done by casting and using a 
delegate.  I don't think pointers to members brought a lot to C++ (apart 
from complexity and syntax) and they seem mostly unnecessary with D's 
delegates. 




More information about the Digitalmars-d mailing list