Stratax 0.3.1
Loading...
Searching...
No Matches
Array Concept Reference

Identifies array-like types through their common logical interface. More...

#include <Concepts.hpp>

Concept definition

template<typename T>
concept Array =
requires (
const std::remove_cvref_t<T>& array,
std::size_t index)
{
typename std::remove_cvref_t<T>::value_type;
{ array.size() } -> std::convertible_to<std::size_t>;
{ array.empty() } -> std::convertible_to<bool>;
{ array.rank() } -> std::convertible_to<std::size_t>;
array.shape();
array.strides();
{ array[index] } -> std::convertible_to<
typename std::remove_cvref_t<T>::value_type>;
{ array.begin() } -> std::input_iterator;
{ array.end() } -> std::sentinel_for<decltype(array.begin())>;
}
Identifies array-like types through their common logical interface.
Definition Concepts.hpp:123

Detailed Description

Identifies array-like types through their common logical interface.

Qualifiers are ignored before checking the type. An array provides a supported value_type, logical shape and stride metadata, size/rank queries, row-major flat indexing, and an input range over the same logical values. Ownership and concrete container identity are intentionally unrestricted.

Template Parameters
TType to classify.

Definition at line 123 of file Concepts.hpp.