What are the benefits from using virtual
and where do inline functions fit in
and when should inline be invoked
Can anyone give us some background information
on how these class procedures interact
Marky_Mark
What are the benefits from using virtual
and where do inline functions fit in
and when should inline be invoked
Can anyone give us some background information
on how these class procedures interact
Marky_Mark
If by this you mean virtual functions, then they allow the correct class methods to be called at runtime, given the base pointer. This also means that classes that are inherited and use virtual methods can be stored in generic containers (you don't need a seperate list/array for each class type).What are the benefits from using virtual
Any class method that has it's implementaion included in the declaration is considered inline, or the implementation can be external and still be inline by explicitly specifying them as inline as you would global functions. They should only be used for small functions that are used often, in which case they'll speed your program up. If you use them on large functions they'll cause code bloat which will increase the chances of cache misses which will slow your program down.where do inline functions fit in
and when should inline be invoked
zen
Im still lost...
Is it cause virtuals are global and visible to all
derived base classes or are virtuals visible to all
classes derived or not
Does inline act as an additional constructor to it's
base class
I think i need to buy a book or two?
Marky_Mark
Last edited by Marky_Mark; 10-27-2001 at 09:19 AM.
No, it depends on the implementation but it's something like each class has a hidden table of function pointers (a v-table) and a pointer that points to the correct function for each instance.Is it cause virtuals are global and visible to all
derived base classes or are virtuals visible to all
classes derived or not
No inlining is independent from inheritance and polymorphism.Does inline act as an additional constructor to it's
base class
Yes.I think i need to buy a book or two?
zen
Thanks zen
Marky_Mark