Member function pointers

Manu turkeyman at gmail.com
Mon Jun 10 07:33:18 PDT 2013


On 11 June 2013 00:28, Michel Fortin <michel.fortin at michelf.ca> wrote:

> On 2013-06-10 14:11:31 +0000, "David Nadlinger" <code at klickverbot.at>
> said:
>
>  On Monday, 10 June 2013 at 14:04:29 UTC, Manu wrote:
>>
>>> On 10 June 2013 23:46, David Nadlinger <code at klickverbot.at>
>>>
>>>> Another less intrusive option would be to just add extern(CppThisCall)
>>>> and
>>>> extern(DThisCall) or something along the lines, which would be
>>>> specified to
>>>> pass the first parameter as if it was a this pointer.
>>>>
>>>
>>> That would also do the business. Do you think that's less intrusive?
>>>
>>
>> Less intrusive in the way that it is a minimal addition to the language
>> itself (we already have several calling conventions), whereas your
>> suggestion would require adding a special case to the grammar.
>>
>> That's not to say I don't like your proposal, though. I just wanted to
>> put the option on the table to be sure we are getting somewhere with this,
>> even if some people might be opposed to the grammar change. This issue has
>> been bugging me for quite some time as well.
>>
>
> It's inelegant, but it could work.
>
> I just find it sad that we have to use a different calling convention for
> member functions. I mean, it'd be much more elegant be if a member function
> could simply be called from a "void function(Object)" by supplying "this"
> as the first argument? Wouldn't it be better to adapt the ABI to fit the
> language rather than adapt the language to fit the ABI?


The ABI is the better part of half a century old...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130611/4e10016d/attachment-0001.html>


More information about the Digitalmars-d mailing list