Hello there.
As asked in topic I wonder if there is any sense of using private inheritance as this:
class Foo
{
public:
void Bar();
};
class Derived : private Foo
{
};
pretty much means the same as that:
class Foo
{
protected:
void Bar();
};
class Derived : public Foo
{
};
Only difference I see is that I choose if I want public elements of Foo class to be inherited as private or if I'd rather like to inherit them as public, but is that flexibility helpful in any way ? I mean, in my opinion private inheritance could possibly just bring mess and chaos to code, but maybe some people in here had an occasion to find that solution helpful ? Thank you very much in advance.