Relative Content

Tag Archive for c++copycopy-assignment

copy assignment without swap

I’m trying to understand copy assignment in C++. I know it’s best to use copy-and-swap idiom for this operator. But for this simple class without consider the Exception safety, when will *ps = *(h.ps); fail? could you please provide some examples where this can go wrong? thanks