M
Michael Winter
Until about 5 minutes ago, I was happy with my knowledge of virtual
functions - then I read "Mixing interface and functional inheritance"
posted by Kevin L. earlier today. All of a sudden, I found out that
you can inherit using the virtual keyword:
class A
{
}
class B : public *virtual* A
{
}
This is new to me and I've *never* seen it before today. I always
assumed that a virtual base class was one that included virtual
methods, whereas it seems class A above is such a class.
So, my question is: what is a virtual base class and why use them?
What is the effect of using them (performance, operation, etc)? What
are the advantages and disadvantages?
If you can't be bothered to give a detailed explanation, a decent web
reference will suffice. My documentation doesn't really say anything
about them, which is why I'm asking here.
Here's hoping I'll learn something new today...
Mike
functions - then I read "Mixing interface and functional inheritance"
posted by Kevin L. earlier today. All of a sudden, I found out that
you can inherit using the virtual keyword:
class A
{
}
class B : public *virtual* A
{
}
This is new to me and I've *never* seen it before today. I always
assumed that a virtual base class was one that included virtual
methods, whereas it seems class A above is such a class.
So, my question is: what is a virtual base class and why use them?
What is the effect of using them (performance, operation, etc)? What
are the advantages and disadvantages?
If you can't be bothered to give a detailed explanation, a decent web
reference will suffice. My documentation doesn't really say anything
about them, which is why I'm asking here.
Here's hoping I'll learn something new today...
Mike