template<UnsignedInt dimensions, class T>
Magnum::Array class

Array.

Template parameters
dimensions Dimension count
T Data type

Unlike Math::Vector this class has implicit constructor from one value.

Public types

enum (anonymous): UnsignedInt { Dimensions = dimensions }
using Type = T
Data type.

Constructors, destructors, conversion operators

Array() constexpr
Default constructor.
template<class ... U>
Array(T first, U... next) constexpr
Initializer-list constructor.
Array(T value) constexpr
Construct array with one value for all fields.
operator Math::Vector<dimensions, T>() const
Convert to a vector.

Public functions

auto operator==(const Array<dimensions, T>& other) const -> bool
Equality.
auto operator!=(const Array<dimensions, T>& other) const -> bool
Non-equality.
auto operator[](UnsignedInt pos) -> T&
Value at given position.
auto operator[](UnsignedInt pos) const -> T constexpr
auto data() -> T*
Raw data.
auto data() const -> const T* constexpr

Enum documentation

template<UnsignedInt dimensions, class T>
enum Magnum::Array<dimensions, T>::(anonymous): UnsignedInt

Enumerators
Dimensions

Dimension count

Function documentation

template<UnsignedInt dimensions, class T>
Magnum::Array<dimensions, T>::Array() constexpr

Default constructor.

Sets all components to their default-constructed values.

template<UnsignedInt dimensions, class T> template<class ... U>
Magnum::Array<dimensions, T>::Array(T first, U... next) constexpr

Initializer-list constructor.

Parameters
first First value
next Next values

template<UnsignedInt dimensions, class T>
T Magnum::Array<dimensions, T>::operator[](UnsignedInt pos) const constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<UnsignedInt dimensions, class T>
T* Magnum::Array<dimensions, T>::data()

Raw data.

Returns One-dimensional array of dimensions length

template<UnsignedInt dimensions, class T>
const T* Magnum::Array<dimensions, T>::data() const constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<UnsignedInt dimensions, class T> template<UnsignedInt dimensions, class T>
Debug& operator<<(Debug& debug, const Array<dimensions, T>& value)

Debug output operator.