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

List:       kde-devel
Subject:    Re: Re: Philosophical question
From:       "David Leimbach" <leimy2k () gmail ! com>
Date:       2006-11-17 21:31:41
Message-ID: 3e1162e60611171331ke7de69ald89db4de3e7bea64 () mail ! gmail ! com
[Download RAW message or body]

On 11/17/06, Cyrille Berger <cberger@cberger.net> wrote:
> > QSomeThing anotherOne = thatThing;
> >
> > and
> >
> > QSomeThing anotherOne(thatThing);
> >
> > ?
> if there is an overloaded version of operator=, then in the first case, the
> operator= is called, and in the second case it's the copy constructor. But if
> there isn't an overloaded version of operator=, it's completely equivalent.

They both call the copy constructor, regardless of whether there's an
operator = or not.

the syntax:

MyClass obj1 = obj2;

doesn't call operator = ever in my experience and understanding of the
C++ standard and always means copy constructors get called.

Dave
>
> --
> --- Cyrille Berger ---
>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
>
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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