I need to cast a class to its protected base:
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());
}
I need to add a Line to an Array but the Object base is not visible. Should I re-impliment its methods publicly or is there an implicit cast operator I could override?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)