virtual method pointer

Gor Gyolchanyan gor.f.gyolchanyan at gmail.com
Fri May 4 07:52:21 PDT 2012


I'm not going to cherry-pick methods in any case. I'll have all
methods analyzed at compile time, by iterating over the overloads of
each method and have them searched in the vtable to get their indices
at launch time. It'll be easy to construct a dynamic virtual method
call.

On Fri, May 4, 2012 at 6:26 PM, Mehrdad <wfunction at hotmail.com> wrote:
> Ah okay. Yeah it's not 'safe' at all... but I think the '6' comes from the
> number of members that Foo has. If you figure out how many methods there are
> in the v-table, then that should get you the index (though don't quote me on
> this... you should look at the compiler source code if you want to be really
> sure).
>
>
> On Friday, 4 May 2012 at 14:16:49 UTC, Gor Gyolchanyan wrote:
>>
>> Yes! Your solution looks exactly like what I wanted. The reason why I
>> considered additional alternatives is because your solutions looks
>> very fast (YES!!!), but not very portable and safe, so after testing,
>> if it turns out to be inconsistent, I'll have to use something else.
>>
>



-- 
Bye,
Gor Gyolchanyan.


More information about the Digitalmars-d mailing list