Matlab clib diamond problem

1 次查看(过去 30 天)
Cristian Le
Cristian Le 2021-1-4
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?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Animation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by