Boost logo

Boost :

Subject: Re: [boost] [pimpl] Mini Review
From: Krzysztof Czainski (1czajnik_at_[hidden])
Date: 2011-05-28 09:08:39


Hi,

I just wanted to add an example...

I think Pimpl should have the following property:

a)
struct X
{
  int f();
private:
  int a_;
};

b)
struct X : public pimpl<X>::value_semantics
{
  int f();
};

The user of class X should not be able to tell the difference between a) and
b).

X x;

Now in this case the user can tell the difference. In b) he can do x.null(),
but in a) he can't. So Pimpl changes the interface. And that's what I want
to avoid. Pimpl or no Pimpl, the interface of X should stay the same.

Regards
Kris


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