Pimpl copying

Peter Kümmel syntheticpp at gmx.net
Mon Jul 17 08:19:08 BST 2006


David Faure wrote:
> 
> Honestly, for all those "how to write library classes" issues, I would say, let's
> just do what Qt does. Consistent, and avoids re-inventing (and re-discussing!)
> the wheel.
> 
> Qt uses QFooPrivate instead of QFoo::Private, maybe the reason is the visibility
> issue, but in any case I'd suggest we just do that.
> 
> Similary, I would suggest just using Q_DISABLE_COPY, etc.
> 

I agree when there is a good solution provided by Qt, but sometimes
Qt also have some drawbacks, especially in cases where a solution requires
template techniques. kde doesn't need to support compilers for embedded systems.

In the pimpl case i think it is better to unify the pimpl declaration with
disabling copying, because then you can't forget it. You also can't forget
destruction, creation. And is the Qt version const correct, I don't think so?

Qt makes heave usage of inheriting when implementing the *Private
classes which makes a template technique a little bit superfluous.
But I'm not sure if this also the case for kde.

Peter




More information about the kde-core-devel mailing list