[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: Pimpl copying
From: Peter_Kümmel <syntheticpp () gmx ! net>
Date: 2006-07-15 8:30:48
Message-ID: 44B8A7B8.7000400 () gmx ! net
[Download RAW message or body]
Alexander Petrov wrote:
> 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
>
I know boost pimpl, it was recently rejected.
I also prefer a template version and had I proposed a template
based solution here on the list, but there was no interest.
http://lists.kde.org/?l=kde-core-devel&m=113981417304925&w=2
Maybe it becomes more interesting when I threat to do it with a macro. :)
I will have a look at the template version again, and try to
incorporate the copying stuff.
Peter
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic