A template class representing an array.
More...
#include <array.hpp>
|
| CONCRETE_TEMPLATE (array, T) |
|
| array (int n=0) |
| Construct a new array object with length 0.
|
|
| array (T *a, int n) |
| Construct a new array object from a C array with specified length.
|
|
| array (T x1, T x2) |
| Construct a new array object with two elements.
|
|
| array (T x1, T x2, T x3) |
| Construct a new array object with three elements.
|
|
| array (T x1, T x2, T x3, T x4) |
| Construct a new array object with four elements.
|
|
| array (T x1, T x2, T x3, T x4, T x5) |
| Construct a new array object with five elements.
|
|
T & | operator[] (int i) |
| Get a reference to the element atthe specified index.
|
|
T * | begin () |
|
T * | end () |
|
template<
class T>
class array< T >
A template class representing an array.
- Template Parameters
-
T | Type of elements in the array. |
Definition at line 95 of file array.hpp.
◆ array() [1/6]
Construct a new array object with length 0.
Definition at line 101 of file array.hpp.
The list class represents a linked list.
◆ array() [2/6]
Construct a new array object from a C array with specified length.
- Template Parameters
-
T | Type of elements in the array. |
- Parameters
-
a | The C array. |
n | The length of the C array. |
Definition at line 57 of file array.ipp.
57 {
58 int i;
60 for (i= 0; i < n; i++)
62}
◆ array() [3/6]
Construct a new array object with two elements.
- Template Parameters
-
T | Type of elements in the array. |
- Parameters
-
x1 | The first element. |
x2 | The second element. |
Definition at line 64 of file array.ipp.
◆ array() [4/6]
Construct a new array object with three elements.
- Template Parameters
-
T | Type of elements in the array. |
- Parameters
-
x1 | The first element. |
x2 | The second element. |
x3 | The third element. |
Definition at line 70 of file array.ipp.
◆ array() [5/6]
Construct a new array object with four elements.
- Template Parameters
-
T | Type of elements in the array. |
- Parameters
-
x1 | The first element. |
x2 | The second element. |
x3 | The third element. |
x4 | The fourth element. |
Definition at line 77 of file array.ipp.
◆ array() [6/6]
Construct a new array object with five elements.
- Template Parameters
-
T | Type of elements in the array. |
- Parameters
-
x1 | The first element. |
x2 | The second element. |
x3 | The third element. |
x4 | The fourth element. |
x5 | The fifth element. |
Definition at line 85 of file array.ipp.
◆ CONCRETE_TEMPLATE()
◆ operator[]()
Get a reference to the element atthe specified index.
- Template Parameters
-
T | Type of elements in the array. |
- Parameters
-
i | The index of the element. |
- Returns
- A reference to the element at the specified index.
Definition at line 161 of file array.hpp.
◆ begin()
T * array< T >::begin |
( |
| ) |
|
|
inlineprivate |
◆ end()
The documentation for this class was generated from the following files: