Corrade::Containers::ArrayTuple::Item class

Array tuple item.

Stores desired size and output view reference. See ArrayTuple for usage introduction.

Constructors, destructors, conversion operators

template<class T>
Item(Corrade::ValueInitT, std::size_t size, ArrayView<T>& outputView)
Construct a view with value-initialized elements.
template<class T>
Item(Corrade::ValueInitT, std::size_t size, StridedArrayView1D<T>& outputView)
template<unsigned dimensions, class T>
Item(Corrade::ValueInitT, const Size<dimensions>& size, StridedArrayView<dimensions, T>& outputView)
Item(Corrade::ValueInitT, std::size_t size, MutableBitArrayView& outputView)
Construct a view with value-initialized elements.
Item(Corrade::ValueInitT, std::size_t size, MutableStridedBitArrayView1D& outputView)
template<unsigned dimensions>
Item(Corrade::ValueInitT, const Size<dimensions>& size, MutableStridedBitArrayView<dimensions>& outputView)
Item(Corrade::ValueInitT, std::size_t size, MutableStringView& outputView, StringViewFlags flags = {})
Construct a view with value-initialized elements.
template<class T>
Item(std::size_t size, ArrayView<T>& outputView)
Construct a view with value-initialized elements.
template<class T>
Item(std::size_t size, StridedArrayView1D<T>& outputView)
template<unsigned dimensions, class T>
Item(const Size<dimensions>& size, StridedArrayView<dimensions, T>& outputView)
Item(std::size_t size, MutableBitArrayView& outputView)
Item(std::size_t size, MutableStridedBitArrayView1D& outputView)
template<unsigned dimensions>
Item(const Size<dimensions>& size, MutableStridedBitArrayView<dimensions>& outputView)
Item(std::size_t size, MutableStringView& outputView, StringViewFlags flags = {})
template<class T>
Item(Corrade::NoInitT, std::size_t size, ArrayView<T>& outputView)
Construct a view without initializing its elements.
template<class T>
Item(Corrade::NoInitT, std::size_t size, StridedArrayView1D<T>& outputView)
template<unsigned dimensions, class T>
Item(Corrade::NoInitT, const Size<dimensions>& size, StridedArrayView<dimensions, T>& outputView)
Item(Corrade::NoInitT, std::size_t size, MutableBitArrayView& outputView)
Construct a view without initializing its elements.
Item(Corrade::NoInitT, std::size_t size, MutableStridedBitArrayView1D& outputView)
template<unsigned dimensions>
Item(Corrade::NoInitT, const Size<dimensions>& size, MutableStridedBitArrayView<dimensions>& outputView)
Item(Corrade::NoInitT, std::size_t size, MutableStringView& outputView, StringViewFlags flags = {})
Construct a view without initializing its contents.
Item(Corrade::NoInitT, std::size_t size, std::size_t elementSize, std::size_t elementAlignment, StridedArrayView2D<char>& outputView)
Construct a type-erased view without initializing its elements.

Function documentation

template<class T>
Corrade::Containers::ArrayTuple::Item::Item(Corrade::ValueInitT, std::size_t size, ArrayView<T>& outputView)

Construct a view with value-initialized elements.

Parameters
size in Desired view size
outputView out Desired type and a reference where to store the resulting view

All size elements are value-initialized (i.e., builtin types are zero-initialized and the default constructor gets called otherwise). Expects that T is default-constructible. If it's not, you have to use Item(NoInitT, std::size_t, ArrayView<T>&) instead and then manually construct each item in-place.

template<class T>
Corrade::Containers::ArrayTuple::Item::Item(Corrade::ValueInitT, std::size_t size, StridedArrayView1D<T>& outputView)

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

template<unsigned dimensions, class T>
Corrade::Containers::ArrayTuple::Item::Item(Corrade::ValueInitT, const Size<dimensions>& size, StridedArrayView<dimensions, T>& outputView)

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

Corrade::Containers::ArrayTuple::Item::Item(Corrade::ValueInitT, std::size_t size, MutableBitArrayView& outputView)

Construct a view with value-initialized elements.

Parameters
size in Desired view size in bits
outputView out Reference where to store the resulting view

All size bits are value-initialized (i.e., zero-initialized).

Corrade::Containers::ArrayTuple::Item::Item(Corrade::ValueInitT, std::size_t size, MutableStridedBitArrayView1D& outputView)

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

template<unsigned dimensions>
Corrade::Containers::ArrayTuple::Item::Item(Corrade::ValueInitT, const Size<dimensions>& size, MutableStridedBitArrayView<dimensions>& outputView)

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

Corrade::Containers::ArrayTuple::Item::Item(Corrade::ValueInitT, std::size_t size, MutableStringView& outputView, StringViewFlags flags = {})

Construct a view with value-initialized elements.

Parameters
size in Desired view size
outputView out Reference where to store the resulting view
flags in Desired string view flags. Only StringViewFlag::NullTerminated is allowed.

All size bytes are value-initialized (i.e., zero-initialized). If flags contains StringViewFlag::NullTerminated, one extra '\0' byte is added after the string.

template<class T>
Corrade::Containers::ArrayTuple::Item::Item(std::size_t size, ArrayView<T>& outputView)

Construct a view with value-initialized elements.

Alias to Item(ValueInitT, std::size_t, ArrayView<T>&).

template<class T>
Corrade::Containers::ArrayTuple::Item::Item(std::size_t size, StridedArrayView1D<T>& outputView)

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

template<unsigned dimensions, class T>
Corrade::Containers::ArrayTuple::Item::Item(const Size<dimensions>& size, StridedArrayView<dimensions, T>& outputView)

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

Corrade::Containers::ArrayTuple::Item::Item(std::size_t size, MutableBitArrayView& outputView)

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

Corrade::Containers::ArrayTuple::Item::Item(std::size_t size, MutableStridedBitArrayView1D& outputView)

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

template<unsigned dimensions>
Corrade::Containers::ArrayTuple::Item::Item(const Size<dimensions>& size, MutableStridedBitArrayView<dimensions>& outputView)

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

Corrade::Containers::ArrayTuple::Item::Item(std::size_t size, MutableStringView& outputView, StringViewFlags flags = {})

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

template<class T>
Corrade::Containers::ArrayTuple::Item::Item(Corrade::NoInitT, std::size_t size, ArrayView<T>& outputView)

Construct a view without initializing its elements.

Parameters
size in Desired view size
outputView out Desired type and a reference where to store the resulting view

Initialize the values using placement new. Useful if you will be overwriting all elements later anyway, or if the elements have no default constructor. Note that for non-trivial types the destructor gets finally called on all elements, regardless of whether they were properly constructed or not.

template<class T>
Corrade::Containers::ArrayTuple::Item::Item(Corrade::NoInitT, std::size_t size, StridedArrayView1D<T>& outputView)

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

template<unsigned dimensions, class T>
Corrade::Containers::ArrayTuple::Item::Item(Corrade::NoInitT, const Size<dimensions>& size, StridedArrayView<dimensions, T>& outputView)

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

Corrade::Containers::ArrayTuple::Item::Item(Corrade::NoInitT, std::size_t size, MutableBitArrayView& outputView)

Construct a view without initializing its elements.

Parameters
size in Desired view size in bits
outputView out Reference where to store the resulting view

Useful if you will be overwriting all elements later anyway.

Corrade::Containers::ArrayTuple::Item::Item(Corrade::NoInitT, std::size_t size, MutableStridedBitArrayView1D& outputView)

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

template<unsigned dimensions>
Corrade::Containers::ArrayTuple::Item::Item(Corrade::NoInitT, const Size<dimensions>& size, MutableStridedBitArrayView<dimensions>& outputView)

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

Corrade::Containers::ArrayTuple::Item::Item(Corrade::NoInitT, std::size_t size, MutableStringView& outputView, StringViewFlags flags = {})

Construct a view without initializing its contents.

Parameters
size in Desired view size
outputView out Reference where to store the resulting view
flags in Desired string view flags. Only StringViewFlag::NullTerminated is allowed.

Useful if you will be overwriting all contents later anyway. If flags contains StringViewFlag::NullTerminated, one extra '\0' byte is added after the string.

Corrade::Containers::ArrayTuple::Item::Item(Corrade::NoInitT, std::size_t size, std::size_t elementSize, std::size_t elementAlignment, StridedArrayView2D<char>& outputView)

Construct a type-erased view without initializing its elements.

Parameters
size in Desired view size
elementSize in Desired view element size
elementAlignment in Desired view element alignment
outputView out Reference where to store the resulting view

A type-erased alternative to Item(Corrade::NoInitT, std::size_t, StridedArrayView1D<T>&) where you set both element size and alignment manually. The resulting outputView has first dimension of size and second of elementSize, with stride elementSize and 1.