HyperspaceExplorer 0.7.1
|
A list of elements of arbitrary type defined at compile time. More...
#include <ArrayList.h>
Public Member Functions | |
ArrayList () | |
Create an ArrayList with default-constructed elements. | |
ArrayList (const T &x) | |
Create an ArrayList with all elements initialized to x . | |
ArrayList (const T &head, const ArrayList< size-1, T > &tail) | |
Create an ArrayList from a smaller ArrayList and an additional element. | |
const T & | head () const |
Return the first element of an ArrayList. | |
T & | head () |
const ArrayList< size-1, T > & | tail () const |
Return an ArrayList that contains all but the first element. | |
ArrayList< size-1, T > & | tail () |
const T & | operator[] (unsigned i) const |
Read-only access to an element of the ArrayList. | |
T & | operator[] (unsigned i) |
Read-write access to an element of the ArrayList. | |
ArrayList< size-1, T > | minusElement (unsigned i) const |
Return an ArrayList that contains all but the given element. | |
bool | contains (const T &x) const |
std::string | toString () const |
String representation. | |
Private Attributes | |
std::pair< T, ArrayList< size-1, T > > | _elements |
Stores the elements of the list in a pair of an element and a shorter list. |
A list of elements of arbitrary type defined at compile time.
size | Number of elements in the ArrayList. |
T | Type of the stored elements. |
Create an ArrayList with all elements initialized to x
.
x | The value all elements of this are initialized to. |
References make_pair().
ArrayList< size, T >::ArrayList | ( | const T & | head, |
const ArrayList< size-1, T > & | tail | ||
) |
Create an ArrayList from a smaller ArrayList and an additional element.
head | Value of the first element |
tail | The rest of the elements |
References make_pair().
Read-only access to an element of the ArrayList.
i | Index of the element accessed. |
Read-write access to an element of the ArrayList.
i | Index of the element accessed. |