X-Git-Url: http://git.silmor.de/gitweb/?p=web%2Fkonrad%2Fchester.git;a=blobdiff_plain;f=dptr_shared.h;fp=dptr_shared.h;h=88dc7a42372103ecb1d1b893ad529dbdbe08a1f0;hp=b82419414cd438b1701fe7d104c6780c18607cf4;hb=5fbfaee0f9f5469f73125a7044d8d26a0724f645;hpb=948744964683dec959bb3f2a9a18903bf20b8cac diff --git a/dptr_shared.h b/dptr_shared.h index b824194..88dc7a4 100644 --- a/dptr_shared.h +++ b/dptr_shared.h @@ -58,5 +58,5 @@ To be used in implementation where the actual d-pointer class is implemented. Class::DPrivate::~DPrivate(){d->detach();}\ Class::DPrivate Class::DPrivate::clone()const{DPrivate r;*(r.d)=*d;return r;}\ Class::DPrivate& Class::DPrivate::operator=(const DPrivate&dp)\ - {d->detach();d=dp.d;d->attach();return *this;} + {if(d!=dp.d){d->detach();d=dp.d;d->attach();}return *this;}