Pimpl copying

Alexander Petrov zowers at gmail.com
Fri Jul 14 23:09:48 BST 2006


Hi

On Friday 14 July 2006 01:05 Peter Kümmel wrote:
> Shouldn't we introduce a coding policy something like this:
>
> Index: ktempdir.h
> ===================================================================
> +#define KDE_PIMPL_BASE_MACRO(COPY_ACCESS,X) \
> +COPY_ACCESS: \
> +       X(const X##&); \
> +       X##& operator=(const X##&); \
> +private: \
> +       class X##Private; \
> +       X##Private* const d;
> +
> +#define KDE_PIMPL_COPYABLE(X)   KDE_PIMPL_BASE_MACRO(public, X)
> +#define KDE_PIMPL_UNCOPYABLE(X) KDE_PIMPL_BASE_MACRO(private,X)
[]
> This introduces a new macro KDE_PIMPL_COPYABLE
> which declares the pimpl AND the copy functions.
>
> KDE_PIMPL_UNCOPYABLE declares the copy functions
> as private, so we get an error at compile time.

everybody hates macros
take a look at boost.pimpl, announced at 
http://lists.boost.org/boost-announce/2006/05/0090.php
there is only template code, which behaves far more better, than macros

> Peter

-- 
BR. Alexander 'zowers' Petrov.    jabber:zowers at jabber.ru    icq:69694782
http://zowers.googlepages.com/    mailto:zowers at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060715/cdf2be40/attachment.sig>


More information about the kde-core-devel mailing list