
On 04/17/2011 10:49 AM, Clinton Mead wrote:
I don't really understand what you mean by this. What part of the implementation has leaked into the interface?
Hi Clinton, What leaks is the implementation of the Pimpl itself. A Pimpl consists of two distinct things: the interface (which the user cares about), and the pointer (which the user need not know about). The user should not know or care that a class is implemented as a Pimpl.
Maybe I've missed the point but what I'm trying to achieve is the opposite. With all the implementations of pimpl I've seen, the "pointer" is leaked into the interface. I'm just trying to unleak it and separate it. The idea is that people can write interfaces without having to specify how pimpl is actually implemented.
It seems to me that this flexibility is for the benefit of the Pimpl
writer, and at the expense of the Pimpl user.
From your example code:
|
unique_pimpl