template<unsigned dimensions, class T>
StridedDimensions class new in 2019.10
Multi-dimensional size and stride for StridedArrayView and StridedBitArrayView.
Main property compared to a plain C array of value is convertibility from/to StaticArrayView, implicit conversion from/to a scalar type in the one-dimensional case and element-wise equality comparison. See StridedArrayView and StridedBitArrayView for actual usage examples.
C++17 structured bindings
If Corrade/get<i>()
overloads are defined inside StridedDimensions itself, a separate header is used for the std::#include <utility>
on some STL implementations. Example:
#include <Corrade/Containers/StructuredBindings.h> … auto [height, width] = Containers::Size2D(16, 32);
Constructors, destructors, conversion operators
- StridedDimensions() constexpr noexcept
- Default constructor.
-
StridedDimensions(Corrade::
ValueInitT) explicit constexpr noexcept - Construct with zero-initialized data.
-
StridedDimensions(Corrade::
NoInitT) explicit noexcept - Construct without initializing the contents.
-
template<class ... Args>StridedDimensions(T first, Args... next) constexpr noexcept
- Constructor.
- StridedDimensions(const T(&values)[dimensions]) constexpr noexcept
- Construct from an array.
-
template<class U, class = decltype(Implementation::StridedDimensionsConverter<dimensions, T, typename std::StridedDimensions(U&& other) constexpr noexcept new in Git master
decay<U && >::type>::from(std:: declval<U && >()))> - Construct from an external representation.
-
template<class U, class = decltype(Implementation::StridedDimensionsConverter<dimensions, T, U>::to(std::operator U() const constexpr noexcept new in Git master
declval<StridedDimensions<dimensions, T>>()))> - Convert to an external representation.
- operator T() const constexpr
- Conversion to a scalar.
Public functions
- auto operator==(const StridedDimensions<dimensions, T>& other) const -> bool
- Equality comparison.
- auto operator!=(const StridedDimensions<dimensions, T>& other) const -> bool
- Non-equality comparison.
-
auto operator[](std::
size_t i) const -> T constexpr - Element access.
-
auto operator[](std::
size_t i) -> T& - Element access.
- auto begin() -> T*
- First element.
- auto begin() const -> const T* constexpr
- auto cbegin() const -> const T* constexpr
- auto end() -> T*
- (One item after) last element
- auto end() const -> const T* constexpr
- auto cend() const -> const T* constexpr
Function documentation
template<unsigned dimensions, class T>
Corrade:: Containers:: StridedDimensions<dimensions, T>:: StridedDimensions() constexpr noexcept
Default constructor.
Equivalent to StridedDimensions(ValueInitT).
template<unsigned dimensions, class T>
template<class U, class = decltype(Implementation::StridedDimensionsConverter<dimensions, T, typename std:: decay<U && >::type>::from(std:: declval<U && >()))>
Corrade:: Containers:: StridedDimensions<dimensions, T>:: StridedDimensions(U&& other) constexpr noexcept new in Git master
Construct from an external representation.
Conversion from a StaticArrayView of the same type and dimension count is builtin.
template<unsigned dimensions, class T>
template<class U, class = decltype(Implementation::StridedDimensionsConverter<dimensions, T, U>::to(std:: declval<StridedDimensions<dimensions, T>>()))>
Corrade:: Containers:: StridedDimensions<dimensions, T>:: operator U() const constexpr noexcept new in Git master
Convert to an external representation.
Conversion to a StaticArrayView of the same type and dimension count is builtin.
template<unsigned dimensions, class T>
Corrade:: Containers:: StridedDimensions<dimensions, T>:: operator T() const constexpr
Conversion to a scalar.
Enabled only for the one-dimensional case.
template<unsigned dimensions, class T>
const T* Corrade:: Containers:: StridedDimensions<dimensions, T>:: begin() 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<unsigned dimensions, class T>
const T* Corrade:: Containers:: StridedDimensions<dimensions, T>:: cbegin() 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<unsigned dimensions, class T>
const T* Corrade:: Containers:: StridedDimensions<dimensions, T>:: end() 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<unsigned dimensions, class T>
const T* Corrade:: Containers:: StridedDimensions<dimensions, T>:: cend() const constexpr
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.