Matlab clib diamond problem

2 views (last 30 days)
Cristian Le
Cristian Le on 4 Jan 2021
Although C++ is able to resolve the diamond problem using virtual classes, I have noticed that MATLAB cannot take advantage of this when writing a clib interface. I have attached a MWE presenting the problem. Putting it simply the header is like this:
class A {
public:
A();
virtual void Hello();
};
class B1 : virtual public A {
public:
B1();
};
class B2 : virtual public A {
public:
B2();
};
class C : virtual public B1, virtual public B2 {
public:
C();
};
In this example there is no ambiguity of what `C.Hello()` is, however when creating this object in Matlab, this fails because of `Access to base class is ambiguous.`. If we overide the definition, this problem is resolved, however this is not ideal for more complicated structure.
Will there be proper support for resolving this problem?

Answers (0)

Categories

Find more on Animation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!