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

List:       kde-core-devel
Subject:    Re: Pimpl copying
From:       Guillaume Laurent <glaurent () telegraph-road ! org>
Date:       2006-07-14 14:44:57
Message-ID: 200607141644.57441.glaurent () telegraph-road ! org
[Download RAW message or body]

On Friday 14 July 2006 11:55, Reinhold Kainhofer wrote:
> 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.

Where does it say this ? AFAIR, it says that in this case, the copy *can* be 
optimised away (11.7 - I'm pretty sure there are other references but I can't 
find them), not that it will.

-- 
Guillaume.
http://www.telegraph-road.org
[prev in list] [next in list] [prev in thread] [next in thread] 

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