c++ Programming Glossary: msize
Dynamically allocating an array of objects http://stackoverflow.com/questions/255612/dynamically-allocating-an-array-of-objects minimum for a class that contains a pointer class A size_t mSize int mArray public Simple constructor destructor are obvious... Simple constructor destructor are obvious. A size_t s 0 mSize s mArray new int mSize ~A delete mArray Copy constructor needs.. are obvious. A size_t s 0 mSize s mArray new int mSize ~A delete mArray Copy constructor needs more work A A const..
What is the copy-and-swap idiom? http://stackoverflow.com/questions/3279543/what-is-the-copy-and-swap-idiom public default constructor dumb_array std size_t size 0 mSize size mArray mSize new int mSize 0 copy constructor dumb_array.. constructor dumb_array std size_t size 0 mSize size mArray mSize new int mSize 0 copy constructor dumb_array const dumb_array.. std size_t size 0 mSize size mArray mSize new int mSize 0 copy constructor dumb_array const dumb_array other mSize..
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.. const dumb_array other if this other if mSize other.mSize delete mArray mArray nullptr mArray other.mSize new int other.mSize.. other.mSize delete mArray mArray nullptr mArray other.mSize new int other.mSize nullptr mSize other.mSize std copy other.mArray..
|