How to overload member function pointer and a regualr member function

ParticlePeter via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Apr 25 11:28:57 PDT 2017


On Tuesday, 25 April 2017 at 16:27:43 UTC, Basile B. wrote:
> On Tuesday, 25 April 2017 at 15:43:48 UTC, ParticlePeter wrote:
>> On Tuesday, 25 April 2017 at 09:50:14 UTC, Basile B. wrote:
>>> On Monday, 24 April 2017 at 16:46:21 UTC, ParticlePeter wrote:
>>
>> Thanks for your reply, but that's what I would like to avoid, 
>> the additional indirection to call the function pointer with 
>> the original argument count.
>
> Oops, i can believe i didn't read the last part of your 
> question.
>
>> Do you have any idea about the likelihood of the compiler 
>> removing this indirection as an optimizations?
>
> with pragma(inline, true), the function body should be injected 
> at the call sites.

This would not help I fear, the body of the function pointer is 
unknown in an external lib. I rather hoped that the compiler 
"sees" the parameter forwarding to the fp and is able to directly 
call it. Best thing would be for both overloads, but I would not 
know how to verify this.


More information about the Digitalmars-d-learn mailing list