Pimpl copying
Thiago Macieira
thiago at kde.org
Wed Jul 19 21:37:15 BST 2006
Peter Kümmel wrote:
>Matthias Kretz wrote:
>> On Tuesday 18 July 2006 14:26, Peter Kümmel wrote:
>>> BTW the cast is the price they pay for their Private "Hinterwelt",
>>> means there is a second class hierarchy behind the scene.
>>
>> The cast is a noop (reinterpret_cast) and therefore not a price payed
>> in performance.
>
>I wonder if a static_cast would not be enought.
Not without defining both classes, so that the compiler knows that there
is an inheritance tree. I think.
>> The cast is safe as long as you don't use multiple inheritance.
>
>Qt: "What is multiple inheritance?" ;)
Not only does Qt use multiple inheritance in some parts, it also has
provisions for it in the meta object system. Think of Q_GADGET and the
plugin architecture.
The only thing that you're not allowed to do is inherit from QObject
multiply -- that is, diamond-shaped multiple inheritance.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- 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/20060719/23a9cde5/attachment.sig>
More information about the kde-core-devel
mailing list