Consider the following example: template <typename T> typename ValueType<T>::value_type modulus(const T &arraymp;x); The definition specifies that if T is an arithmetic type, the return type is also T. If T is not an arithmetic type, such as a Vector, the return type is T::value_type, the type of the elements of T. Thus, if T is an int, then ValueType<T>::value_type is an int. If T is a StaticVector<float, 3u>, then ValueType<T>::value_type is a float.
Promote types to floating-point representations, if possible with a sufficiently
long mantissa to accurately represent the original type.
|
array_type |
The full type of the array, i.e. Array_t<T, N, A>. |
value_type |
The type of the elements in the array, i.e. an alias for template parameter T. |
iterator |
The iterator type over the contents of the array. |
const_iterator |
A const_iterator type (read-only) over the contents of the array. |
reference |
The type of a reference to the elements of the array. |
const_reference |
The type of a read-only reference to the elements of the array. |
slice_type |
The type of a slice of the array. Slices have reference semantics, and cannot be resized. |
slice_traits |
The array_traits type for slices of the array. |
template <typename InputIterator> array_type create(InputIterator input) |
Returns a newly created array with dimensions as specified in the range indicated by input. |
template <typename InputIterator> array_type create(InputIterator input, const T &value) |
Returns a newly created array with dimensions as specified in the range indicated by input, filled with value. |
template <typename U> array_type create(const std::initializer_list<U> init_list) |
Returns a newly created array with dimensions as specified in the initializer_list init_list. |
template <typename U> array_type create(const std::initializer_list<U> init_list, const T &value) |
Returns a newly created array with dimensions as specified in the initializer_list init_list. The array is filled with value. |
std::size_t size(const array_type &array) |
The number of elements in the array. |
template <typename InputIterator> bool resize(Array_t<T, N, Aux> &array, InputIterator input, bool preserve = false) |
Resize the array to the dimensions specified in the range indicated by input, trying to preserve the contents only if preserve is true. |
template <typename U> bool resize(Array_t<T, N, Aux> &array, const std::initializer_list<U> size_list, bool preserve = false) |
Resize the array to the dimensions specified in the initializer_list size_list, trying to preserve the contents only if preserve is true. |
integer_type_const_iterator shape(const Array_t<T, N, Aux> &array |
Returns an iterator to the beginning of a range indicating the shape / dimensions / extents of the array. The exact type of integer_type_const_iterator depends on the implementation. |
array_type ©_of(const array_type &array) |
Returns a new array that is a copy of the given array. |
iterator begin(array_type &array) |
Returns an iterator pointing to the first element in array. |
const_iterator begin(const array_type &array) |
Returns a const_iterator pointing to the first element in array. |
iterator end(array_type &array) |
Returns an iterator pointing to the end of array. |
const_iterator end(const array_type &array) |
Returns an const_iterator pointing to the end of array. |
void swap(array_type &lhs, array_type &rhs) |
Equivalent of std::swap(), chooses optimal implementation. |
Array Functions
The template parameter N refers to the number of dimensions of the arrays to be copied.
template < ... > void copy(const ArrayIn <Tin, N, AuxLhs> & input, ArrayOut<Tout, N, AuxRhs> &output, const bool pad_zero = true);
The function clear() resizes the any array to zero in any dimension, effectively clearing it of any data.
template < ... > void clear(Array<T, N, A> &m);