Virtual inheritance in C++
I found this in a website while reading about virtual inheritance in c++ When multiple inheritance is used, it is sometimes necessary to use virtual inheritance. A good example for this is the standard iostream class hierarchy: //Note: this is a simplified description of iostream classes class ostream: virtual public ios { /*..*/ } class istream: virtual public ios { /*..*/ } class iostream : public istream, public ostream { /*..*/ } //a single ios inherited How does C++ ensure that only a single instance of a virtual member exists, regardless of the number of classes derived from it? C++ uses