¡@

Home 

c++ Programming Glossary: other.msize

What is the copy-and-swap idiom?

http://stackoverflow.com/questions/3279543/what-is-the-copy-and-swap-idiom

copy constructor dumb_array const dumb_array other mSize other.mSize mArray mSize new int mSize 0 note that this is non throwing.. 0 2 see footnote for rationale ...and put in the new mSize other.mSize 3 mArray mSize new int mSize 0 3 std copy other.mArray other.mArray.. data ready before we replace the old std size_t newSize other.mSize int newArray newSize new int newSize 0 3 std copy other.mArray..

Move assignment operator and `if (this != &rhs)`

http://stackoverflow.com/questions/9322174/move-assignment-operator-and-if-this-rhs

operator const dumb_array other if this other if mSize other.mSize delete mArray mArray nullptr mArray other.mSize new int other.mSize.. if mSize other.mSize delete mArray mArray nullptr mArray other.mSize new int other.mSize nullptr mSize other.mSize std copy other.mArray.. delete mArray mArray nullptr mArray other.mSize new int other.mSize nullptr mSize other.mSize std copy other.mArray other.mArray..