CPP07 1.0
|
A template class that represents a dynamic array. [詳解]
#include <Array.hpp>
クラス | |
class | OutOfBoundsException |
Exception thrown when trying to access an element outside the array bounds. [詳解] | |
公開メンバ関数 | |
Array () | |
Default constructor. Creates an empty Array. | |
Array (unsigned int n) | |
Constructor with size. Creates an Array of n elements. | |
Array (const Array &other) | |
Copy constructor. Creates a deep copy of another Array. | |
~Array () | |
Destructor. Frees the allocated memory. | |
Array & | operator= (Array other) |
Assignment operator. Replaces the contents with a copy of another Array. | |
T & | operator[] (unsigned int index) |
Subscript operator for non-const access. | |
const T & | operator[] (unsigned int index) const |
Subscript operator for const access. | |
unsigned int | size () const |
Returns the number of elements in the Array. | |
A template class that represents a dynamic array.
T | The type of elements stored in the array. |
Constructor with size. Creates an Array of n elements.
n | The number of elements to create. |
Subscript operator for non-const access.
index | The index of the element to access. |
OutOfBoundsException | if the index is out of bounds. |
Subscript operator for const access.
index | The index of the element to access. |
OutOfBoundsException | if the index is out of bounds. |
Returns the number of elements in the Array.