template<size_t Dimensions, typename T>
spice::nd_vector_impl<Dimensions, T, true> class

Specialisation of spice::nd_vector template class for owning vectors.

Base classes

template<size_t Dimensions, typename T, bool Owner = true>
class nd_vector_impl

Derived classes

template<typename T>
class image

Constructors, destructors, conversion operators

nd_vector_impl(std::array<size_t, Dimensions> shape, T const& default_value = T{}) explicit
nd_vector_impl(nd_vector_impl<Dimensions, T, true> const& other)
nd_vector_impl(nd_vector_impl<Dimensions, T, false> const& other)
nd_vector_impl(nd_vector_impl&& other) noexcept
nd_vector_impl(std::initializer_list<T> data, std::array<size_t, Dimensions> shape)
~nd_vector_impl()

Public functions

auto data_ptr() -> T*&
Get a reference to the data pointer.
auto operator=(nd_vector_impl const& other) -> nd_vector_impl&
auto operator=(nd_vector_impl&& other) -> nd_vector_impl&

Function documentation

template<size_tDimensions, typenameT>
spice::nd_vector_impl<Dimensions, T, true><Dimensions, T>::nd_vector_impl(std::array<size_t, Dimensions> shape, T const& default_value = T{}) explicit

Constructs a fresh nd_vector with the specified shape, initialising the data with the provided default value (or T{} if none is passed).

template<size_tDimensions, typenameT>
spice::nd_vector_impl<Dimensions, T, true><Dimensions, T>::nd_vector_impl(nd_vector_impl<Dimensions, T, true> const& other)

Copy constructor. Copies the values and shape from other to this.

template<size_tDimensions, typenameT>
spice::nd_vector_impl<Dimensions, T, true><Dimensions, T>::nd_vector_impl(nd_vector_impl<Dimensions, T, false> const& other)

Copies the values and shape from other to this.

template<size_tDimensions, typenameT>
spice::nd_vector_impl<Dimensions, T, true><Dimensions, T>::nd_vector_impl(nd_vector_impl&& other) noexcept

Moves the data from other to this.

template<size_tDimensions, typenameT>
spice::nd_vector_impl<Dimensions, T, true><Dimensions, T>::nd_vector_impl(std::initializer_list<T> data, std::array<size_t, Dimensions> shape)

Constructs a fresh nd_vector with the supplied data and shape.

template<size_tDimensions, typenameT>
spice::nd_vector_impl<Dimensions, T, true><Dimensions, T>::~nd_vector_impl()

Destructor. Deletes data array only if this nd_vector owns it (i.e. if the template argument Owner is true).

template<size_tDimensions, typenameT>
T*& spice::nd_vector_impl<Dimensions, T, true><Dimensions, T>::data_ptr()

Get a reference to the data pointer.

Returns T*&

template<size_tDimensions, typenameT>
nd_vector_impl& spice::nd_vector_impl<Dimensions, T, true><Dimensions, T>::operator=(nd_vector_impl const& other)

Copies the values from other to this. Unlike the copy assignment operator of nd_span, this copies the entire nd_vector and also modifies the size of it.

template<size_tDimensions, typenameT>
nd_vector_impl& spice::nd_vector_impl<Dimensions, T, true><Dimensions, T>::operator=(nd_vector_impl&& other)

Moves the data from other to this, resizing the object as necessary.