geomc 1.0
A c++ linear algebra template library
|
Array storage with templated static or dynamic size, acting as a thin, templated wrapper around a bare array which is memory managed by the caller. More...
#include <geomc/Storage.h>
Public Member Functions | |
WrappedStorage (index_t sz, T *srcdata) | |
Construct a new WrappedStorage and use srcdata as the backing memory. | |
T * | get () |
Return a pointer to the first element in the storage array. | |
const T * | get () const |
Return a const pointer to the first element in the storage array. | |
index_t | size () const |
Return the number of elements in the array. | |
T & | operator[] (index_t idx) |
Return a reference to the i th element in the array. | |
T | operator[] (index_t idx) const |
Return the i th element in the array. | |
Public Attributes | |
T * | data |
Dimension< N >::storage_t | dim |
Array storage with templated static or dynamic size, acting as a thin, templated wrapper around a bare array which is memory managed by the caller.
T | Element type. |
N | Size of the array, or 0 for dynamic size. |
This class is mainly used for when ownership semantics are templated.
#include <geomc/Storage.h>