Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diamond inheritance in C++ #270

Open
tamasborbas opened this issue Aug 19, 2015 · 2 comments
Open

Diamond inheritance in C++ #270

tamasborbas opened this issue Aug 19, 2015 · 2 comments

Comments

@tamasborbas
Copy link
Member

If there is a diamond in the type hierarchy and the super-super class has any method virtual inheritance should be used in the first sub classes of the diamond. The generalization of StatefulClass could be cause problems.

Example

There is the following structure:
image

The inheritance in B and C should be virtual. The code sould looks like this:

class A {
public:
    void a() {}
}

class B : public virtual A {}

class C : public virtual A {}

class D : public B {}

class E : public D, public C {}
@tamasborbas tamasborbas changed the title Diamond inheritance Diamond inheritance in C++ Aug 19, 2015
@abelhegedus abelhegedus modified the milestone: Future Aug 31, 2015
@g2k2c8
Copy link
Contributor

g2k2c8 commented Sep 2, 2015

Not a valid generalization pattern. We do not need to support this

@g2k2c8
Copy link
Contributor

g2k2c8 commented Sep 2, 2015

Gabor will provide additional input

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants