What is Broken Inheritence in OOP ? What are the reasons for it ?
How can we correct such a problem ?

What is Broken Inheritence in OOP ? What are the reasons for it ?
How can we correct such a problem ?

Hi

I would say that with "broken inheritance" is meant that due to some changes, a specific class cannot be any more inherited.

This can happen if u would make the constructor private, and provide a static member (or even friend) function used for the creation of the the type instances . The remedy on this is that instances can be only then created on the heap, not the stack.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.