> Aleksey Gurtovoy <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Fernando Cacciola wrote:
> > "Aleksey Gurtovoy" <[EMAIL PROTECTED]> escribió en el mensaje
> news:[EMAIL PROTECTED]
> > > David Abrahams wrote:
> > > > Here's an example I just cooked up of using the PP lib to solve a
> > > > classic C++ OO problem: repeated boilerplate in the definition of
> > > > Pimpl classes.
> > >
> > > There is another variation of the idiom, sometimes called "hidden
> state",
> > > which doesn't have the shortcoming in the first place:
> > >
> > A shortcoming of the hidden state idiom compared to the classic delegation
> > idiom is that only the state is encapsulated, not the behaviour.
>
> I am not sure what do you mean by "encapsulated". Hidden in a source file as
> opposite to the header?
>
Sort of.
Hidden in any other file different from the file containing the
declaration of the public interface.

> > IOWs, if you need to hide the operations, not just the state, you still
> > need to mirror the interface class member functions into
> > the impl class.
>
> How so? With the hidden state, what would be private member functions
> becomes free functions at the file scope.
>
Ah... you didn't show this in your example... what you're right AFAICT.

Fernando Cacciola




_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to