Re: How to overload member function pointer and a regualr member function

2017-04-26 Thread ParticlePeter via Digitalmars-d-learn
On Wednesday, 26 April 2017 at 08:24:08 UTC, Basile B. wrote: On Tuesday, 25 April 2017 at 18:58:58 UTC, Ali Çehreli wrote: On 04/25/2017 11:54 AM, Ali Çehreli wrote: My analysis is wrong because that writefln() is for the bar(float) overload but I still think what you want is achieved. Ali

Re: How to overload member function pointer and a regualr member function

2017-04-26 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 25 April 2017 at 18:58:58 UTC, Ali Çehreli wrote: On 04/25/2017 11:54 AM, Ali Çehreli wrote: My analysis is wrong because that writefln() is for the bar(float) overload but I still think what you want is achieved. Ali No it's ok, it works. The additional indirection is well

Re: How to overload member function pointer and a regualr member function

2017-04-25 Thread Ali Çehreli via Digitalmars-d-learn
On 04/25/2017 11:54 AM, Ali Çehreli wrote: > _Dmain: > pushRBP > movRBP,RSP > subRSP,010h > movRAX,_D6deneme4funcFifZv@GOTPCREL[RIP] > mov-010h[RBP],RAX > movssXMM0,FLAT:.rodata[00h][RIP] > movss-8[RBP],XMM0 >

Re: How to overload member function pointer and a regualr member function

2017-04-25 Thread Ali Çehreli via Digitalmars-d-learn
On 04/25/2017 11:28 AM, ParticlePeter wrote: > On Tuesday, 25 April 2017 at 16:27:43 UTC, Basile B. wrote: >> 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

Re: How to overload member function pointer and a regualr member function

2017-04-25 Thread ParticlePeter via Digitalmars-d-learn
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

Re: How to overload member function pointer and a regualr member function

2017-04-25 Thread ParticlePeter via Digitalmars-d-learn
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: I would like to have this kind of struct: struct Foo { private int i; void function( int i, float f ) bar; // will be defined at runtime void bar( float f ) {

Re: How to overload member function pointer and a regualr member function

2017-04-25 Thread Basile B. via Digitalmars-d-learn
On Monday, 24 April 2017 at 16:46:21 UTC, ParticlePeter wrote: I would like to have this kind of struct: struct Foo { private int i; void function( int i, float f ) bar; // will be defined at runtime void bar( float f ) { bar( i, f ); } } [...] How else can I get the required

How to overload member function pointer and a regualr member function

2017-04-24 Thread ParticlePeter via Digitalmars-d-learn
I would like to have this kind of struct: struct Foo { private int i; void function( int i, float f ) bar; // will be defined at runtime void bar( float f ) { bar( i, f ); } } But apparently the function pointer and the member function cannot have the same name: Error: function