Matlab clib diamond problem
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Animation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!