解决这一问题的一种可能方法是将结构转换为类,并使用多重继承来获得两种方式的连接。换句话说,我必须制作一个临时版本,目前看起来像:
class foo : protected another {
}
class bar : proteced intersect_bar, protected another {
}
class intersect : protected foo_intersect, protected another {
int aValue;
};
class foo_intersect : private foo {
order next;
foo o_foo;
intersect m_intersect;
};
class intersect_bar : private intersect {
order next;
intersect o_intersect;
bar m_bar;
};
class another : private something {
order ascending;
something o_something;
foo m_foo;
bar m_bar;
intersect m_intersect;
};
这不是一个理想的解决方案,但使用继承图和协作图,我确实从中获得了我想要的大部分信息!一个警告是,原始集合结构允许循环定义,这反过来导致循环继承,这当然是不合法的。。。