#include <arr.h>
Public Member Functions | |
arr () | |
arr (long sz) | |
arr (long sz, const T &inival) | |
arr (const arr &orig) | |
~arr () | |
long | size () const |
void | alloc (long sz) |
void | dealloc () |
void | fill (const T &val) |
arr & | operator= (const arr &orig) |
T & | operator[] (long n) |
T & | operator[] (int n) |
const T & | operator[] (long n) const |
const T & | operator[] (int n) const |
operator T * () | |
operator const T * () const | |
void | sort () |
void | minmax (T &minv, T &maxv) const |
void | transfer (arr &other) |
void | swap (arr &other) |
Definition at line 66 of file arr.h.
|
Creates a zero-sized array. |
|
Creates an array with sz entries. |
|
Creates an array with sz entries, and initializes them with inival. |
|
Creates an array which is a copy of orig. The data in orig is duplicated. |
|
Frees the memory allocated by the object. |
|
Returns the current array size. |
|
Allocates space for sz elements. The content of the array is undefined on exit. sz can be 0. If sz is the same as the current size, no reallocation is performed. |
|
Deallocates the memory held by the array, and sets the array size to 0. |
|
Writes val into every element of the array. |
|
Changes the array to be a copy of orig. |
|
Returns a reference to element #n |
|
Returns a reference to element #n |
|
Returns a constant reference to element #n |
|
Returns a constant reference to element #n |
|
Returns a pointer to the first element, or 0 if the array is zero-sized. |
|
Returns a constant pointer to the first element, or 0 if the array is zero-sized. |
|
Sorts the elements in the array, in ascending order. |
|
Returns the minimum and maximum entry in minv and maxv, respectively. Does nothing if the array is zero-sized. |
|
Assigns the contents and size of other to the array. On exit, other is yero-sized. |
|
Swaps contents and size with other. |