Pimpl copying

Peter Kümmel syntheticpp at gmx.net
Fri Jul 14 08:13:50 BST 2006


Clarence Dang wrote:
> On Friday 14 July 2006 07:05, Peter Kümmel wrote:
>> +KTempDir& KTempDir::operator=(const KTempDir& rhs)
>> +{
>> +       mError = rhs.d->_error;
>> +       mTmpName = rhs.d->_tmpName;
>> +       bExists = rhs.d->_exists;
>> +       bAutoDelete = rhs.d->_autoDelete;
>> +       return *this;
>> +}
> 
> BTW, in general (but not this case), you need:
> 
> if (this == &rhs)
> 	return *this;
> 
> 

Yes, I forgot this.

But I don't understand why not in this case?

Peter




More information about the kde-core-devel mailing list