#include <Containers/ArrayView.h>
template<>
ArrayView<const void> class
Constant void array view.
Specialization of ArrayView which is convertible from a compile-time array, Array, ArrayView or StaticArrayView of any type and also any type convertible to them. Size for a particular type is recalculated to a size in bytes. This specialization doesn't provide any accessors besides data(), because it has no use for the void
type. Instead, use arrayCast(ArrayView<const void>) to first cast the array to a concrete type and then access the particular elements.
Public types
Constructors, destructors, conversion operators
-
ArrayView(std::
nullptr_t = nullptr) constexpr noexcept - Default constructor.
-
ArrayView(const void* data,
std::
size_t size) constexpr noexcept - Construct a view on a type-erased array array with explicit length.
-
template<class T>ArrayView(const T* data, std::
size_t size) constexpr noexcept - Constructor a view on a typed array with explicit length.
-
template<class T, std::ArrayView(T(&data)[size]) constexpr noexcept
size_t size> - Construct a view on a fixed-size array.
- ArrayView(ArrayView<void> array) constexpr noexcept
- Construct a const void view on an ArrayView<void>
-
template<class T>ArrayView(ArrayView<T> array) constexpr noexcept
- Construct a const void view on any ArrayView.
-
template<std::ArrayView(const StaticArrayView<size, T>& array) constexpr noexcept
size_t size, class T> - Construct a const void view on any StaticArrayView.
-
template<class T, class = decltype(Implementation::ErasedArrayViewConverter<const T>::from(std::ArrayView(const T& other) constexpr noexcept
declval<const T&>()))> - Construct a view on an external type / from an external representation.
- operator bool() const explicit constexpr
- Whether the view is non-empty.
- operator const void*() const constexpr
- Conversion to the underlying type.
-
ArrayView(std::
nullptr_t = nullptr) constexpr noexcept - Default constructor.
-
ArrayView(const void* data,
std::
size_t size) constexpr noexcept - Construct a view on an array with explicit size.
- ArrayView(U(&data)[size]) constexpr noexcept
- Construct a view on a fixed-size array.
- ArrayView(ArrayView<U> view) constexpr noexcept
- Construct a view on an ArrayView.
- ArrayView(StaticArrayView<size, U> view) constexpr noexcept
- Construct a view on a StaticArrayView.
- ArrayView(U&& other) constexpr noexcept
- Construct a view on an external type / from an external representation.
- operator U() const constexpr
- Convert the view to external representation.
- operator bool() const explicit constexpr
- Whether the view is non-empty.
- operator const void*() const constexpr
- Conversion to the underlying type.
Public functions
- auto data() const -> const void* constexpr
- View data.
-
auto size() const -> std::
size_t constexpr - View size.
- auto empty() const -> bool constexpr
- Whether the view is empty.
-
auto slice(std::
size_t begin) const -> StaticArrayView<size_, const void> constexpr - auto data() const -> const void* constexpr
- View data.
-
auto size() const -> std::
size_t constexpr - View size.
- auto empty() const -> bool constexpr
- Whether the view is empty.
- auto begin() const -> const void* constexpr
- Pointer to the first element.
- auto cbegin() const -> const void* constexpr
- auto end() const -> const void* constexpr
- Pointer to (one item after) the last element.
- auto cend() const -> const void* constexpr
- auto front() const -> const void& constexpr
- First element.
- auto back() const -> const void& constexpr
- Last element.
-
auto operator[](std::
size_t i) const -> const void& constexpr - Element access.
- auto slice(const void* begin, const void* end) const -> ArrayView<const void> constexpr
- View slice.
-
auto slice(std::
size_t begin, std:: size_t end) const -> ArrayView<const void> constexpr - auto slice(const void* begin) const -> StaticArrayView<size_, const void> constexpr
- Fixed-size view slice.
-
auto slice(std::
size_t begin) const -> StaticArrayView<viewSize, const void> constexpr - auto slice() const -> StaticArrayView<end_ - begin_, const void> constexpr
- Fixed-size view slice.
-
auto slice(std::
size_t begin) const -> StaticArrayView<size_, const void> constexpr -
auto sliceSize(const void* begin,
std::
size_t size) const -> ArrayView<const void> constexpr - View slice of given size.
-
auto sliceSize(std::
size_t begin, std:: size_t size) const -> ArrayView<const void> constexpr - auto sliceSize() const -> StaticArrayView<size_, const void> constexpr
- Fixed-size view slice of given size.
- auto prefix(const void* end) const -> ArrayView<const void> constexpr
- View prefix until a pointer.
-
auto prefix(std::
size_t size) const -> ArrayView<const void> constexpr - View on the first
size
items. - auto prefix() const -> StaticArrayView<size_, const void> constexpr
- Fixed-size view on the first
size_
items. - auto suffix(const void* begin) const -> ArrayView<const void> constexpr
- View suffix after a pointer.
- auto suffix() const -> StaticArrayView<size_, const void> constexpr
- Fixed-size view on the last
size_
items. -
auto exceptPrefix(std::
size_t size) const -> ArrayView<const void> constexpr - View except the first
size
items. -
auto exceptSuffix(std::
size_t size) const -> ArrayView<const void> constexpr - View except the last
size
items.
Function documentation
template<>
Death:: Containers:: ArrayView<const void>:: ArrayView(std:: nullptr_t = nullptr) constexpr noexcept
Default constructor.
Creates an empty nullptr
view. Copy a non-empty Array or ArrayView onto the instance to make it useful.
template<>
Death:: Containers:: ArrayView<const void>:: ArrayView(const void* data,
std:: size_t size) constexpr noexcept
Construct a view on a type-erased array array with explicit length.
Parameters | |
---|---|
data | Data pointer |
size | Data size in bytes |
template<>
template<class T>
Death:: Containers:: ArrayView<const void>:: ArrayView(const T* data,
std:: size_t size) constexpr noexcept
Constructor a view on a typed array with explicit length.
Parameters | |
---|---|
data | Data pointer |
size | Data size |
Size is recalculated to size in bytes.
template<>
template<class T, std:: size_t size>
Death:: Containers:: ArrayView<const void>:: ArrayView(T(&data)[size]) constexpr noexcept
Construct a view on a fixed-size array.
Parameters | |
---|---|
data | Fixed-size array |
Size in bytes is calculated automatically.