N
Nikolay Kurtov
http://www.parashift.com/c++-faq-lite/strange-inheritance.html#faq-23.11offers
a solution of the problem:
class Fred;
class FredBase {
private:
friend class Fred;
FredBase() { }
};
class Fred : private virtual FredBase {
public:
...
};
The only thing I want to know is why did he make FredBase a virtual
base. It works even if inheritance is non-virtual. Why virtual
inheritance is better??
a solution of the problem:
class Fred;
class FredBase {
private:
friend class Fred;
FredBase() { }
};
class Fred : private virtual FredBase {
public:
...
};
The only thing I want to know is why did he make FredBase a virtual
base. It works even if inheritance is non-virtual. Why virtual
inheritance is better??