Boost logo

Boost Users :

Subject: Re: [Boost-users] Pimpl framework comments/suggestions
From: Rob Riggs (rob_at_[hidden])
Date: 2011-04-18 00:47:45


On 04/17/2011 07:10 PM, Clinton Mead wrote:
>
> And if Klass is the interface, won't it need to contain another
> pointer, which would result in following two pointers instead of one
> for all method calls?

Who cares? It's a reasonable price for what Pimpl buys you. The price
of that encapsulation is a little indirection. With the added benefit
that it can be used as a plain old value type (no pointer, except the
one hidden inside).

If that cost is too much to bear, Pimpl isn't the right answer in the
first place.

I think you might be missing the point about why Pimpl is such a rockin'
cool idea. It is an extremely simple mechanism for ensuring ABI
stability. If it's no longer dead simple, it completely loses its
charm; it becomes harder to maintain a stable ABI. Library writers
don't want that.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net