Virtual inline functions where the type is not known

This might strike you as a contradiction in terms, but a virtual inline makes perfect sense. If the compiler knows the type of the object statically, it's called as an inline. If the type is not known statically, a virtual function call is made. If you are using an inline for valid reasons, such as when a pointer or reference is used to access the object, this can be a useful technique. The this pointer is included, so calls to virtual inline members of the same object always occur virtually. Recall that writing MyMember(); is equivalent to writing this->MyMember();.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker