Originally Posted by
George2
Thanks brewbuck,
I do not quite understand your below comments. Could you provide more description please or some pseudo code? Especially what do you mean "take advantage of how inheritance normally works" and parent class's methods are "just there."?
Say you had some underlying class which provides functionality X() and Y(). Suppose the class looks like this:
Code:
class ClassGuts
{
public:
someThing();
someThingElse();
};
So the job of the Pimpl wrapper is to implement X() and Y() in terms of someThing() and someThingElse(). The two some*() functions are implementation details. The user will only see X() and Y(). So suppose you inherit from the wrapper. You can still call X() and Y() but you can't access the underlying ClassGuts object because that's the whole point of having a wrapper. You could inherit from ClassGuts directly, but now you've rendered the Pimpl idiom irrelevant.