December 2001
Intermediate to advanced
304 pages
6h 25m
English
Difficulty: 4
Overriding inherited virtual functions is easy, as long as you're not trying to override a virtual function that has the same signature in two base classes. This can happen even when the base classes don't come from different vendors! What's the best way to separate such “Siamese Twin” functions?
Consider the following two classes:
class BaseA
{
virtual int ReadBuf( const char* );
// ...
};
class BaseB
{
virtual int ReadBuf( const char* );
// ...
};
Both BaseA and BaseB are clearly intended to be used as base classes, but they are otherwise unrelated. Their ReadBuf() functions are intended to do different things, and the classes come from different library vendors.
Demonstrate ...
Read now
Unlock full access