i have seen this word in interview question .
i don't know if this kind of thing is existing or not. may be it is same as multiple path inheritance(diamond problem)!
This is a discussion on anyone knows what is virtual path inheritance ? within the C++ Programming forums, part of the General Programming Boards category; i have seen this word in interview question . i don't know if this kind of thing is existing or ...
i have seen this word in interview question .
i don't know if this kind of thing is existing or not. may be it is same as multiple path inheritance(diamond problem)!
Look here
I have never heard of the specific term "virtual path inheritance", but C_ntua seems to think that it is the same thing as virtual inheritance.
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
The "diamond of death" refers to a derived class having more than one instance of a base class through multiple inheritence, in circumstances where only one instance is wanted.
An example of the hierarchy is;
Problems associated with the "diamond of death" are resolved by declaring the Base to be a virtual base of both A and B.Code:class Base { // members }; class A : public Base { // members }; class B : public Base { // members }; class Derived : public A, public B { // members }
Doing this achieves what is sometimes described as "virtual path inheritence". Personally, I consider it a woeful description, but some people seem to like it.
Right 98% of the time, and don't care about the other 3%.
Did anybody here actually ever encounter this problem? I've coded quite a lot in C++, all object oriented, but I've never created a diamond pattern...
There is the rather famous example of std::basic_ios, std::basic_istream, std::basic_ostream and std::basic_iostream.Originally Posted by EVOEx
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way