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 !=std::dynamic_extent) 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 !=std::dynamic_extent) const expr Span(Vec &vec) | |
template<Vectorlike Vec> requires (std::is_same_v<std::add_const_t<typename Vec::value_type>, std::add_const_t<T>>) | |
explicit (N !=std::dynamic_extent) const expr Span(const Vec &vec) | |
constexpr | Span (typename Base::pointer p) |
subspan | |
Wrappers for | |
constexpr Span< T, std::dynamic_extent > | subspan (size_t i, size_t n=std::dynamic_extent) const |
template<size_t i, size_t n = std::dynamic_extent> | |
constexpr Span< T, n !=std::dynamic_extent ? n :(N !=std::dynamic_extent ? N - i :std::dynamic_extent)> | subspan () const |
E.g.: If span points to 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 , then the result will point to 2, 3, 4, 5, 6 . | |
rsubspan | |
Similar to Span::subspan but in reverse: | |
constexpr Span< T, std::dynamic_extent > | rsubspan (size_t i, size_t n=std::dynamic_extent) const |
template<size_t i, size_t n = std::dynamic_extent> | |
constexpr Span< T, n !=std::dynamic_extent ? n :(N !=std::dynamic_extent ? N - i :std::dynamic_extent)> | rsubspan () const |
span.rsubspan(3, 5) removes the last 3 elements and while picking 5 elements onwards from there. | |
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 37 of file span.h.
Referenced by mim::Span< T, N >::rsubspan().
|
inlineexplicitconstexpr |
|
inline |
|
inline |
|
inline |
|
inlineconstexpr |
span.rsubspan(3, 5)
removes the last 3 elements and while picking 5 elements onwards from there.
Definition at line 76 of file span.h.
References mim::Span< T, N >::Span().
|
inlineconstexpr |
Definition at line 69 of file span.h.
References mim::Span< T, N >::subspan().
|
inlineconstexpr |
E.g.: If span
points to 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
, then the result will point to 2, 3, 4, 5, 6
.
Definition at line 61 of file span.h.
References mim::Span< T, N >::subspan().
Referenced by mim::Span< T, N >::rsubspan(), and mim::Span< T, N >::subspan().