Pimpl copying

Reinhold Kainhofer reinhold at kainhofer.com
Fri Jul 14 10:55:41 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Freitag, 14. Juli 2006 11:28 schrieb Lubos Lunak:
> On Friday 14 July 2006 10:33, André Wöbbeking wrote:
> > On Thursday 13 July 2006 23:05, Peter Kümmel wrote:
> > >  void KTempDirTest::testBasic()
> > >  {
> > > -       KTempDir dir = KTempDir("test");
> >
> > normal ctor and then copy ctor
>
>  No. It's just syntactic sugar functionally completely equivalent to the
> case below with just normal ctor. If any compiler uses copy ctor here it's
> broken.

Stroustrup's book says that 
   KTempDir dir = KTempDir("test");
and 
   KTempDir dir("test");
are equivalent. I.e. the first one should not use ctor and then copy. I had a 
similar discussion with Mark a while ago (we were discussion which one was 
more efficient. Turned out they should be the same)

Cheers,
Reinhold


- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: reinhold at kainhofer.com, http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD4DBQFEt2ohTqjEwhXvPN0RAi19AJ47pIL+sG7uzGXGhK8RvpIv8AGz5wCUCWVZ
E1gBl5lsi8cgFu85iklJqQ==
=w4pr
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list