[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Pimpl copying
From:       Matthias Kretz <kretz () kde ! org>
Date:       2006-07-18 14:52:29
Message-ID: 200607181652.32972.kretz () kde ! org
[Download RAW message or body]


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. The cast is safe as long as you don't use multiple inheritance. 
So never expect the following to work:

class APrivate
{
};

class A
{
	Q_DECLARE_PRIVATE(A)
};

class B
{
};

class CPrivate : public APrivate
{
};

class C : public B, public A
{
	Q_DECLARE_PRIVATE(C)
}

-- 
C'ya
        Matthias
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz@gmx.net, kretz@kde.org,
Matthias.Kretz@urz.uni-heidelberg.de

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic