19template <
class T>
class array;
84 friend class array<T>;
129 array (T x1, T x2, T x3);
140 array (T x1, T x2, T x3, T x4);
152 array (T x1, T x2, T x3, T x4, T x5);
168#define TMPL template <class T>
T * A(array< T > a)
Get a pointer to the first element of the array.
int N(array< T > a)
Get the length of the array.
array< T > reverse(array< T > a)
Reverse an array.
array< T > operator*(array< T > a, T c)
Multiply an array object by a scalar value of type T.
int hash(array< T > a)
This function computes the hash of an array object a.
array< T > range(array< T > a, int i, int j)
Get a subarray of an array.
bool contains(T a, array< T > b)
Check if an array contains a specified element.
bool operator!=(array< T > a, array< T > b)
Check if two arrays are not equal.
bool operator==(array< T > a, array< T > b)
Check if two arrays are equal.
array< T > copy(array< T > x)
Make a copy of an array.
tm_ostream & operator<<(tm_ostream &out, array< T > a)
Output the array to an output stream.
array< T > append(T a, array< T > b)
Append an element to the beginning of an array.
array< T > operator/(array< T > a, T c)
Divide an array object by a scalar value of type T.
A concrete struct representing the implementation of an array.
friend array< T > copy LESSGTR(array< T > a)
friend T *A LESSGTR(array< T > a)
array_rep()
Construct a new array representation object with length 0.
~array_rep()
Destroy the array representation object.
friend int N LESSGTR(array< T > a)
void resize(int n)
Resize the array length to n.
A template class representing an array.
T & operator[](int i)
Get a reference to the element atthe specified index.
array(int n=0)
Construct a new array object with length 0.
CONCRETE_TEMPLATE(array, T)
#define CONCRETE_TEMPLATE_CODE(PTR, TT, T)
Macro used to define the implementation of a concrete smart pointer with reference counting for a sin...
The list class represents a linked list.
void tm_delete_array(C *Ptr)
Structure representing a concrete object with a reference count.