A
Amy Matlock
Hi all:
How does the hardware work if you invoke a BASE::METHOD() on a DERIVED class
member? Do you still hit the v-table dynamically at run time?
Suppose you have a derived class method, but you use the :: scoping operator
to directly call the base class method.
Like this:
class BASE
{
virtual int METHOD () { return 0 };
}
class DERIVED : public BASE
{
virtual int METHOD () { return 1 };
}
I understand that if you call METHOD() on a DERIVED class member, then you
will hit the v-table, as per section 20.4 of the site below:
http://www.parashift.com/c++-faq-lite/virtual-functions.html
My question is, how does the hardware work if you invoke a BASE::METHOD() on
a DERIVED class member? Do you still hit the v-table dynamically at run
time?
Thanks in advance for your time,
ACM.
How does the hardware work if you invoke a BASE::METHOD() on a DERIVED class
member? Do you still hit the v-table dynamically at run time?
Suppose you have a derived class method, but you use the :: scoping operator
to directly call the base class method.
Like this:
class BASE
{
virtual int METHOD () { return 0 };
}
class DERIVED : public BASE
{
virtual int METHOD () { return 1 };
}
I understand that if you call METHOD() on a DERIVED class member, then you
will hit the v-table, as per section 20.4 of the site below:
http://www.parashift.com/c++-faq-lite/virtual-functions.html
My question is, how does the hardware work if you invoke a BASE::METHOD() on
a DERIVED class member? Do you still hit the v-table dynamically at run
time?
Thanks in advance for your time,
ACM.