Boost logo

Boost :

From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2005-10-04 09:35:49


On 10/4/05, Asger Mangaard <tmb_at_[hidden]> wrote:
>
> The pimpl idiom hides the implementation of a given class/struct and all
> including members from your hpp file. This decreases the compile times
> greatly. It then relies on the actual implementation to be inside the cpp
> file. Just like in the 'testsuite' example that's included with the zip
> file.

My understanding is that the class that holds the pimpl (lets call it the
Interface class) generally provides forwarding methods that invoke methods
on an Implementation class (the class pointed to by m_pImpl). From what I
can see of your implementation, if a user wants to invoke
Implementation::foo, they will need to include Implementation.h, which
effectively negates the benefit of pimpl in the first place.

I'd call what you've provided a "Pimpl *Holder*", and not a Generic Pimpl
(which I don't think can be implemented anyway).

--
Caleb Epstein
caleb dot epstein at gmail dot com

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