Heidelberg Educational Numerics Library Version 0.24 (from 9 September 2011)
|
A basic dynamic array class. More...
#include <array.hh>
Public Types | |
typedef T | value_type |
Remember the storage type. | |
typedef value_type & | reference |
Reference to an object. | |
typedef const value_type & | const_reference |
Const reference to an object. | |
typedef std::size_t | size_type |
Type used for array indices. | |
typedef std::ptrdiff_t | difference_type |
Difference type. | |
Public Member Functions | |
Array () | |
make empty array | |
Array (size_type _n) | |
make array with _n uninitialized components | |
Array (size_type _n, const T &_t) | |
make array with _n initialized components | |
Array (const Array &a) | |
copy constructor | |
~Array () | |
destructor, free dynamic memory | |
void | resize (size_type _n) |
reallocate array to given size, any data is lost | |
void | resize (size_type _n, const T &_t) |
reallocate array to given size, any data is lost | |
Array & | operator= (const Array &a) |
assignment | |
reference | operator[] (size_type i) |
Component access. | |
const_reference | operator[] (size_type i) const |
Const component access. | |
size_type | size () const |
get array size |
A basic dynamic array class.
Provides a dyamically allocated array with access operator, resizing and size method.