Inline virtual method

S

Sharad Kala

olegerm said:
Does anybody know can a virtual method be inline?

Of course, it can.
Please explain.

If you invoke a virtual member function on an entity whose dynamic type is
known to compiler then it can go ahead and inline it. E.g. when you invoke
it on an object (and not base class pointer/reference), then compiler knows
the static and dynamic types and can inline the call, of course if it wishes
to do so!

Sharad
 
O

olegerm

Thank you.

Sharad Kala said:
Of course, it can.


If you invoke a virtual member function on an entity whose dynamic type is
known to compiler then it can go ahead and inline it. E.g. when you invoke
it on an object (and not base class pointer/reference), then compiler knows
the static and dynamic types and can inline the call, of course if it wishes
to do so!

Sharad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top