我需要将一个类转换为其受保护的基础:
class ComplicatedOne : public Object {
//Lots of funcs I don't want or need.
};
class Line : protected ComplicatedOne {
//Some funcs of ComplicatedOne get re-implemented or called by alias here
};
class Array {
void Add (Object &obj);
};
main() {
Array a;
a.Add(new Line());
}
我需要添加一个Line
,Array
但Object
基地是不可见的。我应该公开重新实现它的方法,还是有一个我可以覆盖的隐式转换运算符?