Boost logo

Boost :

From: Fernando Cacciola (fernando_cacciola_at_[hidden])
Date: 2003-08-04 07:48:35


> Aleksey Gurtovoy <agurtovoy_at_[hidden]> wrote in message
news:003001c35947$1ca2b080$b344a8c0_at_metacomm.com...
> Fernando Cacciola wrote:
> > "Aleksey Gurtovoy" <agurtovoy_at_[hidden]> escribió en el mensaje
> news:045f01c3587c$5fa650b0$9a44a8c0_at_metacomm.com...
> > > 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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk