MimIR 0.1
MimIR is my Intermediate Representation
|
This is a thin wrapper for std::span<T, N>
with the following additional features:
More...
#include <mim/util/span.h>
Public Types | |
using | Base = std::span<T, N> |
Public Member Functions | |
Constructors | |
explicit (N !=D) const expr Span(std | |
constexpr | Span (std::span< T, N > span) noexcept |
template<Vectorlike Vec> requires (std::is_same_v<typename Vec::value_type, T>) | |
explicit (N !=D) const expr Span(Vec &vec) noexcept(noexcept(vec.data()) &&noexcept(vec.size())) | |
template<Vectorlike Vec> requires (std::is_same_v<std::add_const_t<typename Vec::value_type>, std::add_const_t<T>>) | |
explicit (N !=D) const expr Span(const Vec &vec) noexcept(noexcept(vec.data()) &&noexcept(vec.size())) | |
constexpr | Span (typename Base::pointer p) noexcept |
subspan | |
Wrappers for Example: If
| |
constexpr Span< T, D > | subspan (size_t i, size_t n=D) const noexcept |
template<size_t i, size_t n = D> | |
constexpr Span< T, n !=D ? n :(N !=D ? N - i :D)> | subspan () const noexcept |
rsubspan | |
Similar to Span::subspan but in reverse: | |
constexpr Span< T, D > | rsubspan (size_t i, size_t n=D) const noexcept |
template<size_t i, size_t n = D> | |
constexpr Span< T, n !=D ? n :(N !=D ? N - i :D)> | rsubspan () const noexcept |
span.rsubspan(3, 5) removes the last 3 elements and picks 5 elements starting before those. | |
Static Public Attributes | |
static constexpr auto | D = std::dynamic_extent |
This is a thin wrapper for std::span<T, N>
with the following additional features:
std::initializer_list
(C++26 will get this ...)N != std::dynamic_extent:
using mim::Span< T, N >::Base = std::span<T, N> |
|
inlineconstexprnoexcept |
Definition at line 38 of file span.h.
Referenced by mim::Span< const T, N >::rsubspan().
|
inlineexplicitconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
Definition at line 61 of file span.h.
Referenced by mim::Span< const T, N >::rsubspan(), and mim::Span< const T, N >::subspan().
|
staticconstexpr |