a template class holding a C-array of constant size. More...
#include "Array.hpp"
Public Member Functions | |
assignment, swapping | |
template<typename T2 > | |
Array< T, N > & | operator= (const Array< T2, N > &other) |
assignment with type conversion | |
template<typename T2 > | |
Array< T, N > & | operator= (const T2(&other)[N]) |
assign a C-array with type conversion | |
void | assign (const T &val) |
assign one value to all elements | |
void | swap (Array< T, N > &other) |
swap (linear complexity) | |
iterator traversal | |
forward/reverse, const/non-const | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
direct element access with range check | |
zero-based indexing | |
reference | operator[] (size_type i) |
const_reference | operator[] (size_type i) const |
reference | at (size_type i) |
const_reference | at (size_type i) const |
first/last element | |
reference | front () |
const_reference | front () const |
reference | back () |
const_reference | back () const |
direct access to C-array | |
const T * | data () const |
T * | data () |
T * | c_array () |
Public Attributes | |
const typedef T * | const_iterator |
const typedef T & | const_reference |
T | elems [N] |
Related Functions | |
(Note that these are not member functions.) | |
template<class T , std::size_t N> | |
bool | operator== (const Array< T, N > &l, const Array< T, N > &r) |
template<class T , std::size_t N> | |
bool | operator< (const Array< T, N > &l, const Array< T, N > &r) |
template<class T , std::size_t N> | |
bool | operator!= (const Array< T, N > &l, const Array< T, N > &r) |
template<class T , std::size_t N> | |
bool | operator> (const Array< T, N > &l, const Array< T, N > &r) |
template<class T , std::size_t N> | |
bool | operator<= (const Array< T, N > &l, const Array< T, N > &r) |
template<class T , std::size_t N> | |
bool | operator>= (const Array< T, N > &l, const Array< T, N > &r) |
template<class T , std::size_t N> | |
void | swap (Array< T, N > &l, Array< T, N > &r) |
size | |
static size_type | size () |
static bool | empty () |
static size_type | max_size () |
a template class holding a C-array of constant size.
T | the element type |
N | the constant size, must be >= 1 |
Array is an aggregate, meaning that it may be initialized with a static initializer list: opals::Array<double,3> arr = { 1., 2., 3. }; Array fulfills almost all the requirements of an STL reversible container. The complete implementation is exposed, why opals users may instantiate Array<T,N> with arbitrary template arguments. The class closely follows boost::array.