class XGDynArray

Declared in <XDynArray.h>
Declared from XGArray

This is the definition of a dynamic array template. This version of the template expands to the largest memory footprint, but also calls the constructor and destructors of the items stored in the array, as well as using the copy method of the object. This version is for storing arrays of C++ objects.


Construction/Destruction

XGDynArray::XGDynArray
XGDynArray::operator =
XGDynArray::~XGDynArray

Element Access

XGDynArray::Insert
XGDynArray::operator +=
XGDynArray::operator []


Construction/Destruction

XGDynArray::XGDynArray

Usage: XGDynArray()

Constructs an empty array.

XGDynArray::operator =

Usage: const XGDynArrayay()Tlt;&&operator=(const XGDynArrayment Trty(&old)

Copies the contents of this array to another array, destroying the old array and using the copy operator to move the array elements

XGDynArray::~XGDynArray

Usage: virtual~XGDynArray()

Destroys this object, as well as destroying the dynamic array of objects by calling each destructor

Element Access

XGDynArray::Insert

Usage: void Insert(long i,const T&t)

This inserts the specified element at the location given. The index is a zero-based index; if i is zero, this inserts at the beginning. If i is the length, appends to the end.

XGDynArray::operator +=

Usage: XGDynArrayt(lo T i,c&operator+=(const T&t)

This appends the specified item to the end of the array.

XGDynArray::operator []

Usage: T&operator[](long l)const

This returns a reference to the specified item