Go to the documentation of this file.
9 #ifndef EAGINE_MEMORY_SPLIT_SPAN_HPP
10 #define EAGINE_MEMORY_SPLIT_SPAN_HPP
14 namespace eagine::memory {
24 typename Pointer = ValueType*,
47 constexpr
auto head() const noexcept {
48 return head(_span, _split);
54 constexpr
auto tail() const noexcept {
55 return skip(_span, _split);
70 _split = _span.size();
81 #endif // EAGINE_MEMORY_SPLIT_SPAN_HPP
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
constexpr auto head() const noexcept
Returns the part of the block before the split (split not included).
Definition: split_span.hpp:47
auto skip_to_end() noexcept -> auto &
Moves the split to the end of the block.
Definition: split_span.hpp:69
constexpr auto tail() const noexcept
Returns the part of the block starting at the split until the end.
Definition: split_span.hpp:54
Non-owning view of a contiguous range of memory with ValueType elements.
Definition: flatten_fwd.hpp:16
static constexpr auto skip(basic_span< T, P, S > s, L l) noexcept -> basic_span< T, P, S >
Skips a specified count of elements from the front of a span.
Definition: span_algo.hpp:60
auto advance(span_size_t amount) noexcept -> auto &
Moves the split by the specified amout (number of bytes).
Definition: split_span.hpp:61
constexpr auto split_position() const noexcept -> span_size_t
Returns the position of split as count of bytes since beginning.
Definition: split_span.hpp:40
Template for classes representing a memory span split in two parts.
Definition: split_span.hpp:26
constexpr basic_split_span(basic_span< ValueType, Pointer, SizeType > spn) noexcept
Initializing constructor.
Definition: split_span.hpp:32
constexpr basic_split_span() noexcept=default
Default constructor.