Pimpl copying

Clarence Dang dang at kde.org
Fri Jul 14 03:36:47 BST 2006


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;




More information about the kde-core-devel mailing list