¡@

Home 

c++ Programming Glossary: marray

Dynamically allocating an array of objects

http://stackoverflow.com/questions/255612/dynamically-allocating-an-array-of-objects

with the definition of A below. class A std vector int mArray public A A size_t s mArray s Looking at your problem A arrayOfAs.. A below. class A std vector int mArray public A A size_t s mArray s Looking at your problem A arrayOfAs new A 5 for int i 0 i.. a class that contains a pointer class A size_t mSize int mArray public Simple constructor destructor are obvious. A size_t s..

What is the copy-and-swap idiom?

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

constructor dumb_array std size_t size 0 mSize size mArray mSize new int mSize 0 copy constructor dumb_array const dumb_array.. dumb_array const dumb_array other mSize other.mSize mArray mSize new int mSize 0 note that this is non throwing because.. be given in a more general case however std copy other.mArray other.mArray mSize mArray destructor ~dumb_array delete mArray..