template<>
Corrade::Containers::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.. See ArrayView class docs for usage examples.

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::size_t size>
ArrayView(T(&data)[size]) constexpr noexcept
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::size_t size, class T>
ArrayView(const StaticArrayView<size, T>& array) constexpr noexcept
Construct a const void view on any StaticArrayView.
template<class T, class = decltype(Implementation::ErasedArrayViewConverter<const T>::from(std::declval<const T&>()))>
ArrayView(const T& other) constexpr noexcept
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.

Public functions

auto data() const -> const void* constexpr
View data.
auto size() const -> std::size_t constexpr
View size.
auto isEmpty() const -> bool constexpr new in Git master
Whether the view is empty.
auto empty() const -> bool deprecated in Git master constexpr
Whether the view is empty.

Public variables

const typedef void Type
Element type.

Function documentation

template<>
Corrade::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<>
Corrade::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>
Corrade::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>
Corrade::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.

template<> template<class T, class = decltype(Implementation::ErasedArrayViewConverter<const T>::from(std::declval<const T&>()))>
Corrade::Containers::ArrayView<const void>::ArrayView(const T& other) constexpr noexcept

Construct a view on an external type / from an external representation.

template<>
std::size_t Corrade::Containers::ArrayView<const void>::size() const constexpr

View size.

template<>
bool Corrade::Containers::ArrayView<const void>::isEmpty() const constexpr new in Git master

Whether the view is empty.

template<>
bool Corrade::Containers::ArrayView<const void>::empty() const constexpr

Whether the view is empty.