|
jiwoo
Automatic memory management of containers of array pointers
|
Array of equilength arrays. More...
#include <EquilengthArrays.hpp>
Public Member Functions | |
| EquilengthArrays ()=default | |
| EquilengthArrays (std::size_t size, std::size_t length) | |
| EquilengthArrays (std::size_t size, std::size_t length, Value_ fill) | |
| EquilengthArrays (const EquilengthArrays &other) | |
| EquilengthArrays (EquilengthArrays &&other) noexcept | |
| ~EquilengthArrays () | |
| EquilengthArrays & | operator= (const EquilengthArrays &other) |
| EquilengthArrays & | operator= (EquilengthArrays &&other) noexcept |
| void | swap (EquilengthArrays &other) noexcept |
| std::size_t | size () const |
| std::size_t | length () const |
| bool | empty () const |
| Value_ * | operator[] (std::size_t i) |
| const Value_ * | operator[] (std::size_t i) const |
| Value_ *const * | get () |
| const Value_ *const * | get () const |
| Value_ * | front () |
| const Value_ * | front () const |
| Value_ * | back () |
| const Value_ * | back () const |
| Value_ *const * | begin () |
| const Value_ *const * | begin () const |
| Value_ *const * | end () |
| const Value_ *const * | end () const |
Array of equilength arrays.
| Value_ | Value of the inner arrays. |
An instance x of this class is such that x[i][j] yields a Value_ for i in [0, size) and j in [0, length).
|
default |
Default constructor. This does not perform any allocation and sets the size and length to zero.
|
inline |
| size | Number of inner arrays. |
| length | Length of each inner array. |
This constructor will not initialize the values of the inner arrays. If an initial value is desired, consider using the overloaded constructor below.
|
inline |
| size | Number of inner arrays. |
| length | Length of each inner array. |
| fill | Initial value with which to fill the inner arrays. |
|
inline |
Copy constructor.
| other | An EquilengthArray to be copied. |
|
inlinenoexcept |
Move constructor.
| other | An EquilengthArray to move from. On return, this has its size set to zero. |
|
inline |
Destructor.
|
inline |
This method is only valid if size() is positive.
|
inline |
This method is only valid if size() is positive.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
This method is only valid if size() is positive.
|
inline |
This method is only valid if size() is positive.
|
inline |
|
inline |
const pointer to the start of the array of pointers to all inner arrays.
|
inline |
|
inline |
Copy assignment. This will attempt to use as much of the current object's existing allocation as possible, otherwise it will perform a new allocation.
| other | An EquilengthArray to be copied. |
|
inlinenoexcept |
Move assignment.
| other | An EquilengthArray to be moved from. On return, this will have its size and length set to zero. |
|
inline |
| i | Index of the inner array. This should be non-negative and less than size(). |
i-th inner array.
|
inline |
| i | Index of the inner array. This should be non-negative and less than size(). |
const pointer to the start of the i-th inner array.
|
inline |
|
inlinenoexcept |
| other | An EquilengthArray to swap contents with. On return, *this will have the contents of other and vice versa. |