Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
Combining functions with multiple inheritance?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Dasuraga, post: 3665074"] I'm rather new to the object-oriented aspects of C++, and this is the first time I've had to construct some classes with multiple inheritance. I'd rather not make a variable just to identify what type an object is (leading to using a case, which somewhat defeats the utility of derived classes). So, here's my problem. I have a couple classes in this layout(simplistically): class A{ void f()=0; } class B:virtual public A{ void f(); } class C:virtual public A{ void f(); } class D:virtual public A{ void f(); } class E:virtual public B,virtual public C{}; class F:virtual public B,virtual public D{}; So, is there a way to make it so that E::f() automatically invokes B::f(), then C::f()( similarly for F::f())? If not, is there a better layout that you might be able to suggest? [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Combining functions with multiple inheritance?
Top