Member function pointers

Manu turkeyman at gmail.com
Mon Jun 10 08:36:35 PDT 2013


On 11 June 2013 00:43, Jacob Carlborg <doob at me.com> wrote:

> On 2013-06-10 15:47, Manu wrote:
>
>  I'm really not asking for delegates (although they could become more
>> typesafe given my suggestion), just a member function pointer. And not
>> C++ style as you say, my suggestion is much simpler than that, and would
>> fit nicely in D.
>>
>
> I give up, I don't understand what you want.


...a member function pointer syntax. It's not that complex.

My suggestion is: void function(T this) funcptr;
This is a function pointer (not a delegate), but using keyword 'this' gives
the critical detail to the compiler that it's a member function pointer,
and to use the appropriate calling convention when making calls through
this pointer.
UFCS makes it awesome.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130611/c9b4abb8/attachment.html>


More information about the Digitalmars-d mailing list