#include <array.h>
Public Member Functions | |
Array () | |
Array (Index n) | |
Array (Index n, const base &fill) | |
Constructor filling with constant value. | |
Array (const Array< base > &A) | |
Array & | operator= (base x) |
Assignment from base type (fill entire Array with this value). | |
Array & | operator= (const Array< base > &A) |
Assignment from another Array. | |
Index | nelem () const |
Number of elements. | |
const base & | operator[] (Index n) const |
Constant index operator. | |
base & | operator[] (Index n) |
Non-constant index operator. |
A simple define does not do for this, since I have to implement member functions like nelem, in order to be consistent with Vector.
Because constructors are not inherited, I have to re-define all costructors. In addition to the constructors here, explicit constructors are provided by the derived class MakeArray.
Definition at line 47 of file array.h.
Assignment from another Array.
The Behavior of this one is a bit special: If the size of the target Array is 0 then it will be automatically resized to match (this is needed to have the correct initialization for constructed classes that use the assignment operator to initialize their data).
In all other cases sizes must match exactly!