Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does virtual inheritance and virtual function use the same vtable?

There is one little related question. But the topic is entirely different.

Now, one concept is about the function resolution and another is about class resolution ? I am wondering that how is it possible if they are using the same vtable (at least in gcc-4.5) ? Is this a compiler dependent terminology ?

I know that it might appear as basic silly question, but I had never thought of it.

like image 587
iammilind Avatar asked Sep 17 '26 05:09

iammilind


1 Answers

A good reference for this sort of thing is the Itanium ABI - see eg http://mentorembedded.github.com/cxx-abi/abi.html#vtable. Despite the name it's a widely used ABI for C++ and it describes a good, working implementation (although obviously other implementations are possible).

like image 76
Alan Stokes Avatar answered Sep 18 '26 19:09

Alan Stokes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!