template<size_t Dimensions, typename T>
nd_vector_impl<Dimensions, T, true> class
Contents
Specialisation of spice::
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.