
Vladimir Batov wrote:
Marc,
Just uploaded v0.6 which supports building of two separate class hierarchies -- separately for interfaces and for implementations as described in GoF Pattern Bible for the Bridge pattern.
The interface hierarchy is built as
struct Base : public pimpl<Base>::pointer_semantics {...};
struct Derived : public Base {...}
etc.
The implementation hierarchy is still hidden and is built as
template<> struct pimpl<Base>::implementation {...};
template<> struct pimpl<Derived>::implementation : public pimpl<Base>::implementation {...};
etc.
Marc, let me know if that looks right for your purpose as I myself have no use for deep inheritance trees to test them out.
Best, Vladimir.
Marc,
I have re-read the Bridge pattern in GoF Pattern Bible. Their example is just what you describe in your example. I agree that having/supporting two separate hierarchies is an elegant solution to a few problems. Let me think how pimpl<> might support that.
Out of curiosity in this and all other examples of this pimpl library public inheritance is used. Isn't this an implemented in terms (spelled private) of rather than an IS-A (spelled public) relationship? I'm sure there is a technical reason I'm missing. Thanks, Michael Marcin