Template Class FixedStorage#

Class Documentation#

template<typename Scalar_, size_t... Size_>
class FixedStorage#

Public Types

using Scalar = Scalar_#
using Pointer = Scalar*#
using ConstPointer = const Scalar*#
using Reference = Scalar&#
using ConstReference = const Scalar&#
using SizeType = size_t#
using DifferenceType = ptrdiff_t#
using Iterator = typename std::array<Scalar, product<Size_...>()>::iterator#
using ConstIterator = typename std::array<Scalar, product<Size_...>()>::const_iterator#
using ReverseIterator = std::reverse_iterator<Iterator>#
using ConstReverseIterator = std::reverse_iterator<ConstIterator>#

Public Functions

FixedStorage()#

Default constructor.

explicit FixedStorage(const Scalar &value)#

Create a FixedStorage object filled with value

Parameters

value – Value to fill the FixedStorage object with

FixedStorage(const FixedStorage &other)#

Create a FixedStorage object from another FixedStorage object

Parameters

otherFixedStorage object to copy

FixedStorage(FixedStorage &&other) noexcept#

Move constructor for a FixedStorage object

Parameters

otherFixedStorage object to move

explicit FixedStorage(const std::initializer_list<Scalar> &list)#

Create a FixedStorage object from a std::initializer_list

Template Parameters

V – Type of the elements in the initializer list

Parameters

list – Initializer list to copy

explicit FixedStorage(const std::vector<Scalar> &vec)#

Create a FixedStorage object from a std::vector

Template Parameters

V – Type of the elements in the vector

Parameters

vecVector to copy

FixedStorage &operator=(const FixedStorage &other) noexcept#

Assignment operator for a FixedStorage object

Parameters

otherFixedStorage object to copy

Returns

*this

FixedStorage &operator=(FixedStorage &&other) noexcept = default#

Move assignment operator for a FixedStorage object

Parameters

otherFixedStorage object to move

Returns

*this

~FixedStorage() = default#

Free a FixedStorage object.

void resize(SizeType newSize)#

Resize a Storage object to size elements. Existing elements are preserved.

Parameters

size – New size of the Storage object

void resize(SizeType newSize, int)#

Resize a Storage object to size elements. Existing elements are not preserved

Parameters

size – New size of the Storage object

SizeType size() const noexcept#

Return the number of elements in the FixedStorage object

Returns

Number of elements in the FixedStorage object

FixedStorage copy() const#

Create a copy of the FixedStorage object.

Returns

Copy of the FixedStorage object

ConstReference operator[](SizeType index) const#

Const access to the element at index index

Parameters

index – Index of the element to access

Returns

Const reference to the element at index index

Reference operator[](SizeType index)#

Access to the element at index index

Parameters

index – Index of the element to access

Returns

Reference to the element at index index

Pointer data() const noexcept#
Iterator begin() noexcept#
Iterator end() noexcept#
ConstIterator begin() const noexcept#
ConstIterator end() const noexcept#
ConstIterator cbegin() const noexcept#
ConstIterator cend() const noexcept#
ReverseIterator rbegin() noexcept#
ReverseIterator rend() noexcept#
ConstReverseIterator rbegin() const noexcept#
ConstReverseIterator rend() const noexcept#
ConstReverseIterator crbegin() const noexcept#
ConstReverseIterator crend() const noexcept#
template<typename ShapeType>
auto defaultShape() -> ShapeType#

Public Static Functions

template<typename ShapeType>
static ShapeType defaultShape()

Public Static Attributes

static constexpr SizeType Size = product<Size_...>()#