|
template<typename T > |
static constexpr auto | eagine::memory::as_address (T *addr) noexcept |
| Casts a pointer to basic_address.
|
|
static constexpr auto | eagine::memory::misalignment (const_address addr, span_size_t alignment) noexcept |
| Returns the misalignment of a memory address to the specified alignment.
|
|
static constexpr auto | eagine::memory::misalignment (const void *ptr, span_size_t alignment) noexcept |
| Returns the misalignment of a pointer to the specified alignment.
|
|
static constexpr auto | eagine::memory::is_aligned_to (const_address addr, span_size_t alignment) noexcept |
| Indicates if a memory address aligned to the specified alignment.
|
|
static constexpr auto | eagine::memory::is_aligned_to (const void *ptr, span_size_t alignment) noexcept |
| Indicates if a pointer is aligned to the specified alignment.
|
|
template<typename T > |
static constexpr auto | eagine::memory::is_aligned_as (const_address addr, type_identity< T > tid={}) noexcept |
| Indicates if a memory address aligned as the specified type T.
|
|
template<bool IsConst> |
static constexpr auto | eagine::memory::align_up (basic_address< IsConst > addr, span_size_t align, span_size_t max) noexcept -> basic_address< IsConst > |
| Aligns a memory address up to the specified alignment. More...
|
|
template<bool IsConst> |
static constexpr auto | eagine::memory::align_down (basic_address< IsConst > addr, span_size_t align, span_size_t max) noexcept -> basic_address< IsConst > |
| Aligns a memory address down to the specified alignment. More...
|
|
template<bool IsConst> |
static constexpr auto | eagine::memory::align_down (basic_address< IsConst > addr, span_size_t align) noexcept |
| Aligns a memory address down to the specified alignment.
|
|
static auto | eagine::memory::align_down (const byte *ptr, span_size_t align) -> const byte * |
| Aligns a byte pointer down to the specified alignment.
|
|
template<typename T > |
static constexpr auto | eagine::memory::align_up_to (basic_address< std::is_const_v< T >> addr, type_identity< T >={}, span_size_t align=span_align_of< T >(), span_size_t max=span_size_of< T >()) noexcept |
| Aligns a memory address up to the required alignment of type T. More...
|
|
template<typename T > |
static constexpr auto | eagine::memory::align_down_to (basic_address< std::is_const_v< T >> addr, type_identity< T >={}, span_size_t align=span_align_of< T >(), span_size_t max=span_size_of< T >()) noexcept |
| Aligns a memory address down to the required alignment of type T. More...
|
|
static constexpr auto | eagine::memory::misalignment (span_size_t addr, span_size_t alignment) noexcept -> span_size_t |
| Calculates basic numeric address misalignment.
|
|
static constexpr auto | eagine::memory::misalignment (std::nullptr_t, span_size_t) noexcept -> span_size_t |
| Calculates basic numeric address misalignment.
|
|
static constexpr auto | eagine::memory::is_aligned_to (span_size_t addr, span_size_t algn) noexcept |
| Indicates if a basic numeric address is aligned.
|
|
static constexpr auto | eagine::memory::is_aligned_to (std::nullptr_t, span_size_t) noexcept |
| Indicates if a basic numeric address is aligned.
|
|
template<typename T > |
static constexpr auto | eagine::memory::is_aligned_as (span_size_t addr, type_identity< T >={}) noexcept |
| Indicates if a basic numeric address is aligned to alignment of type T.
|
|
template<typename T , typename P , typename S > |
static constexpr auto | eagine::memory::as_bytes (basic_span< T, P, S > spn) noexcept -> basic_block< std::is_const_v< T >> |
| Converts a span into a basic_block. More...
|
|
static constexpr auto | eagine::memory::as_chars (block blk) noexcept |
| Converts a block into a span of characters. More...
|
|
static constexpr auto | eagine::memory::as_chars (const_block blk) noexcept |
| Converts a block into a span of characters. More...
|
|
static auto | eagine::memory::copy (const_block source, block dest) -> block |
| Copies the content of source block to destination block. More...
|
|
static auto | eagine::memory::copy_into (const_block source, buffer &dest) -> block |
| Copies the content of source block to destination buffer. More...
|
|
template<typename P , typename O > |
static constexpr auto | eagine::memory::as_address (basic_offset_ptr< P, O > op) noexcept -> basic_address< std::is_const_v< P >> |
| Converts basic_offset_ptr into basic_address.
|
|
template<typename T , typename P , typename S > |
static constexpr auto | eagine::memory::relative (basic_span< T, P, S > spn) noexcept -> basic_span< T, basic_offset_ptr< T, std::make_signed_t< S >>, S > |
| Converts argument to span using an offset pointer type. More...
|
|
template<typename T , typename P , typename S > |
static constexpr auto | eagine::memory::absolute (basic_span< T, P, S > spn) noexcept -> basic_span< T, T *, S > |
| Converts argument to span using a native pointer type. More...
|
|
template<typename T > |
static constexpr auto | eagine::memory::view_one (const T &value) noexcept -> const_span< T > |
| Creates a single-const-element view over the specified value.
|
|
template<typename T > |
static constexpr auto | eagine::memory::cover_one (T &value) noexcept -> span_if_mutable< T > |
| Creates a single-element mutable span over the specified value.
|
|
template<typename T > |
static constexpr auto | eagine::memory::view_one (const T *pointer) noexcept -> const_span< T > |
| Creates a single-const-element view from the specified pointer.
|
|
template<typename T > |
static constexpr auto | eagine::memory::cover_one (T *pointer) noexcept -> span_if_mutable< T > |
| Creates a single-element mutable span from the specified pointer.
|
|
template<typename T , typename S > |
static constexpr auto | eagine::memory::view (T *addr, S size) noexcept -> const_span< T > |
| Creates a view starting at the specified pointer and specified length.
|
|
template<typename T , typename S > |
static constexpr auto | eagine::memory::cover (T *addr, S size) noexcept -> span_if_mutable< T > |
| Creates a span starting at the specified pointer and specified length.
|
|
template<typename T , typename S > |
static constexpr auto | eagine::memory::view (const_address addr, S size) noexcept -> const_span< T > |
| Creates a view starting at the specified address and specified length.
|
|
template<typename T , typename S > |
static constexpr auto | eagine::memory::cover (address addr, S size) noexcept -> span_if_mutable< T > |
| Creates a span starting at the specified address and specified length.
|
|
template<typename T , std::size_t N> |
static constexpr auto | eagine::memory::view (const T(&array)[N]) noexcept -> const_span< T > |
| Creates a const view over the specified fixed-size array.
|
|
template<typename T , std::size_t N> |
static constexpr auto | eagine::memory::cover (T(&array)[N]) noexcept -> span_if_mutable< T > |
| Creates a mutable span covering the specified fixed-size array.
|
|
template<typename T > |
static constexpr auto | eagine::memory::view (std::initializer_list< T > il) noexcept -> const_span< T > |
| Creates a const view over the specified initializer list.
|
|
template<typename C , typename = std::enable_if_t<has_span_data_member_v<C> && has_span_size_member_v<C>>> |
static constexpr auto | eagine::memory::view (const C &container) noexcept |
| Creates a const view over a compatible contiguous container.
|
|
template<typename C , typename = std::enable_if_t<has_span_data_member_v<C> && has_span_size_member_v<C>>> |
static constexpr auto | eagine::memory::cover (C &container) noexcept |
| Creates a mutable span covering a compatible contiguous container.
|
|
template<typename T , typename B , typename P , typename S > |
static constexpr auto | eagine::memory::accomodate (basic_span< B, P, S > blk, type_identity< T > tid={}) noexcept -> basic_span< std::add_const_t< T >, rebind_pointer_t< P, T >, S > |
| Returns a span, rebinding the element type (typically from basic_block). More...
|
|
template<typename T , typename P , typename S > |
static constexpr auto | eagine::memory::extract (basic_span< T, P, S > spn) noexcept -> T & |
| Overload of extract for spans. Returns the first element,. More...
|
|
template<typename T , typename P , typename S > |
static constexpr auto | eagine::memory::extract_or (basic_span< T, P, S > spn, T &fallback) noexcept -> T & |
| Overload of extract_or for spans. Returns the first element,.
|
|
template<typename T , typename P , typename S , typename F > |
static constexpr auto | eagine::memory::extract_or (basic_span< T, P, S > spn, F &&fallback) -> std::enable_if_t< std::is_convertible_v< F, T >, T > |
| Overload of extract_or for spans. Returns the first element,.
|
|
template<typename T , typename P , typename S , typename I , typename L > |
static constexpr auto | eagine::memory::slice (basic_span< T, P, S > s, I i, L l) noexcept -> basic_span< T, P, S > |
| Returns a slice of span starting at specified index with specified length. More...
|
|
template<typename T , typename P , typename S , typename L > |
static constexpr auto | eagine::memory::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. More...
|
|
template<typename T , typename P , typename S , typename L > |
static constexpr auto | eagine::memory::snip (basic_span< T, P, S > s, L l) noexcept -> basic_span< T, P, S > |
| Snips a specified count of elements from the back of a span. More...
|
|
template<typename T , typename P , typename S , typename L > |
static constexpr auto | eagine::memory::shrink (basic_span< T, P, S > s, L l) noexcept -> basic_span< T, P, S > |
| Shrinks a span by removing a specified count of elements from both sides. More...
|
|
template<typename T , typename P , typename S , typename L > |
static constexpr auto | eagine::memory::head (basic_span< T, P, S > s, L l) noexcept -> basic_span< T, P, S > |
| Returns the first l elements from the front of a span. More...
|
|
template<typename Ts , typename Ps , typename Ss , typename Tl , typename Pl , typename Sl > |
static constexpr auto | eagine::memory::head (basic_span< Ts, Ps, Ss > s, basic_span< Tl, Pl, Sl > l) noexcept -> basic_span< Ts, Ps, Ss > |
| Returns the head of s l.size() elements long. More...
|
|
template<typename T , typename P , typename S , typename L > |
static constexpr auto | eagine::memory::tail (basic_span< T, P, S > s, L l) noexcept -> basic_span< T, P, S > |
| Returns the last l elements from the back of a span. More...
|
|
template<typename Ts , typename Ps , typename Ss , typename Tl , typename Pl , typename Sl > |
static constexpr auto | eagine::memory::tail (basic_span< Ts, Ps, Ss > s, basic_span< Tl, Pl, Sl > l) noexcept -> basic_span< Ts, Ps, Ss > |
| Returns the tail of s l.size() elements long. More...
|
|
template<typename T1 , typename P1 , typename S1 , typename T2 , typename P2 , typename S2 > |
static constexpr auto | eagine::memory::starts_with (basic_span< T1, P1, S1 > spn, basic_span< T2, P2, S2 > with) -> bool |
| Indicates if span spn starts with the content of with . More...
|
|
template<typename T1 , typename P1 , typename S1 , typename T2 , typename P2 , typename S2 > |
static constexpr auto | eagine::memory::ends_with (basic_span< T1, P1, S1 > spn, basic_span< T2, P2, S2 > with) -> bool |
| Indicates if span spn ends with the content of with . More...
|
|
template<typename T1 , typename P1 , typename S1 , typename T2 , typename P2 , typename S2 > |
static constexpr auto | eagine::memory::strip_prefix (basic_span< T1, P1, S1 > spn, basic_span< T2, P2, S2 > prefix) -> basic_span< T1, P1, S1 > |
| Strips the specified prefix from a span. More...
|
|
template<typename T1 , typename P1 , typename S1 , typename T2 , typename P2 , typename S2 > |
static constexpr auto | eagine::memory::strip_suffix (basic_span< T1, P1, S1 > spn, basic_span< T2, P2, S2 > suffix) -> basic_span< T1, P1, S1 > |
| Strips the specified suffix from a span. More...
|
|
template<typename T1 , typename P1 , typename S1 , typename T2 , typename P2 , typename S2 > |
static constexpr auto | eagine::memory::contains (basic_span< T1, P1, S1 > spn, basic_span< T2, P2, S2 > what) noexcept -> S1 |
| Indicates if a span contains the contents of what . More...
|
|
template<typename T1 , typename P1 , typename S1 , typename T2 , typename P2 , typename S2 > |
static constexpr auto | eagine::memory::find_position (basic_span< T1, P1, S1 > spn, basic_span< T2, P2, S2 > what) noexcept -> optionally_valid< S1 > |
| Finds the position of the first occurrence of what in a span. More...
|
|
template<typename T , typename P , typename S , typename E > |
static constexpr auto | eagine::memory::find_element (basic_span< T, P, S > spn, E what) noexcept -> optionally_valid< S > |
| Finds the position of the first occurrence of what in a span. More...
|
|
template<typename T , typename P , typename S , typename F > |
static constexpr auto | eagine::memory::find_element_if (basic_span< T, P, S > spn, F predicate) noexcept -> optionally_valid< S > |
| Finds the position of the first element satisfying predicate in a span. More...
|
|
template<typename T , typename P , typename S , typename Predicate > |
static constexpr auto | eagine::memory::skip_until (basic_span< T, P, S > spn, Predicate predicate) noexcept -> basic_span< T, P, S > |
| Skips the elements from the front of a span until predicate is satisfied. More...
|
|
template<typename T , typename P , typename S , typename Predicate > |
static constexpr auto | eagine::memory::take_until (basic_span< T, P, S > spn, Predicate predicate) noexcept -> basic_span< T, P, S > |
| Takes the elements from the front of a span until predicate is satisfied. More...
|
|
template<typename T1 , typename P1 , typename S1 , typename T2 , typename P2 , typename S2 > |
static constexpr auto | eagine::memory::reverse_find_position (basic_span< T1, P1, S1 > spn, basic_span< T2, P2, S2 > what) noexcept -> optionally_valid< S1 > |
| Finds the position of the last occurrence of what in a span. More...
|
|
template<typename T1 , typename P1 , typename S1 , typename T2 , typename P2 , typename S2 > |
static auto | eagine::memory::find (basic_span< T1, P1, S1 > where, basic_span< T2, P2, S2 > what) -> basic_span< T1, P1, S1 > |
| Finds the position of the last occurrence of what in a span. More...
|
|
template<typename T1 , typename P1 , typename S1 , typename T2 , typename P2 , typename S2 > |
static auto | eagine::memory::slice_before (basic_span< T1, P1, S1 > spn, basic_span< T2, P2, S2 > what) -> basic_span< T1, P1, S1 > |
| Returns a slice of span before the first occurrence of what . More...
|
|
template<typename T1 , typename P1 , typename S1 , typename T2 , typename P2 , typename S2 > |
static auto | eagine::memory::slice_after (basic_span< T1, P1, S1 > spn, basic_span< T2, P2, S2 > what) -> basic_span< T1, P1, S1 > |
| Returns a slice of span after the first occurrence of what . More...
|
|
template<typename T1 , typename P1 , typename S1 , typename T2 , typename P2 , typename S2 > |
static auto | eagine::memory::split_by_first (basic_span< T1, P1, S1 > spn, basic_span< T2, P2, S2 > what) -> std::tuple< basic_span< T1, P1, S1 >, basic_span< T1, P1, S1 >> |
| Splits a span by the first occurrence of what (before and after, what) More...
|
|
template<typename T1 , typename P1 , typename S1 , typename T2 , typename P2 , typename S2 > |
static auto | eagine::memory::slice_before_last (basic_span< T1, P1, S1 > spn, basic_span< T2, P2, S2 > what) -> basic_span< T1, P1, S1 > |
| Returns a slice of span before the last occurrence of what . More...
|
|
template<typename T1 , typename P1 , typename S1 , typename T2 , typename P2 , typename S2 > |
static auto | eagine::memory::slice_after_last (basic_span< T1, P1, S1 > spn, basic_span< T2, P2, S2 > what) -> basic_span< T1, P1, S1 > |
| Returns a slice of span after the last occurrence of what . More...
|
|
template<typename T1 , typename P1 , typename S1 , typename T2 , typename P2 , typename S2 > |
static auto | eagine::memory::split_by_last (basic_span< T1, P1, S1 > spn, basic_span< T2, P2, S2 > what) -> std::tuple< basic_span< T1, P1, S1 >, basic_span< T1, P1, S1 >> |
| Splits a span by the last occurrence of what (before and after, what) More...
|
|
template<typename T , typename P , typename S , typename B > |
static auto | eagine::memory::slice_inside_brackets (basic_span< T, P, S > spn, B left, B right) noexcept -> basic_span< T, P, S > |
| Returns a slice of span within a pair of brackets. More...
|
|
template<typename TF , typename PF , typename SF , typename TT , typename PT , typename ST > |
static auto | eagine::memory::copy (basic_span< TF, PF, SF > from, basic_span< TT, PT, ST > to) -> basic_span< TT, PT, ST > |
| Copies the elements from one span to another compatible span. More...
|
|
template<typename T , typename P , typename S , typename V > |
static auto | eagine::memory::fill (basic_span< T, P, S > spn, const V &v) -> basic_span< T, P, S > |
| Fills a span with copies of the specified value. More...
|
|
template<typename T , typename P , typename S > |
static auto | eagine::memory::zero (basic_span< T, P, S > spn) -> std::enable_if_t< std::is_integral_v< T >||std::is_floating_point_v< T >, basic_span< T, P, S >> |
| Fills a span with zero value of type T. More...
|
|
template<typename T , typename P , typename S > |
static auto | eagine::memory::reverse (basic_span< T, P, S > spn) -> basic_span< T, P, S > |
| Reverses the elements in a span. More...
|
|
template<typename T , typename P , typename S , typename Transform > |
static auto | eagine::memory::transform (basic_span< T, P, S > spn, Transform function) -> basic_span< T, P, S > |
| Transforms the elements of a span with a function . More...
|
|
template<typename T , typename P , typename S , typename Generator > |
static auto | eagine::memory::generate (basic_span< T, P, S > spn, Generator gen) -> basic_span< T, P, S > |
| Fills a span with elements generated by a generator callable. More...
|
|
template<typename T , typename P , typename S , typename RandGen > |
static auto | eagine::memory::shuffle (basic_span< T, P, S > spn, RandGen rg) -> basic_span< T, P, S > |
| Shuffles the elements of a span. More...
|
|
template<typename T , typename P , typename S > |
static auto | eagine::memory::sort (basic_span< T, P, S > spn) -> basic_span< T, P, S > |
| Sorts the elements of a span. More...
|
|
template<typename T , typename P , typename S , typename Compare > |
static auto | eagine::memory::sort (basic_span< T, P, S > spn, Compare compare) -> basic_span< T, P, S > |
| Sorts the elements of a span according to compare . More...
|
|
template<typename T , typename P , typename S , typename I , typename PI , typename SI , typename Compare > |
static auto | eagine::memory::make_index (basic_span< T, P, S > spn, basic_span< I, PI, SI > idx, Compare compare) -> bool |
| Makes the index of a span according to compare , into another span. More...
|
|
template<typename T , typename P , typename S , typename I , typename PI , typename SI > |
static auto | eagine::memory::make_index (basic_span< T, P, S > spn, basic_span< I, PI, SI > idx) -> bool |
| Makes the index of a span, into another span. More...
|
|
template<typename T , typename P , typename S > |
static auto | eagine::memory::is_sorted (basic_span< T, P, S > spn) -> bool |
| Tests if the elements in a span are sorted. More...
|
|
template<typename T , typename P , typename S , typename Compare > |
static auto | eagine::memory::is_sorted (basic_span< T, P, S > spn, Compare compare) -> bool |
| Tests if the elements in a span are sorted according to compare . More...
|
|
template<typename T , typename P , typename S , typename Output > |
static auto | list_to_stream (Output &out, memory::basic_span< T, P, S > s) -> Output & |
| Helper function for pretty-printing spans as lists into output streams. More...
|
|
template<typename Input , typename T , typename P , typename S > |
static auto | read_from_stream (Input &in, memory::basic_span< T, P, S > s) -> auto & |
| Helper function for raw-reading spans from output streams. More...
|
|
template<typename Output , typename T , typename P , typename S > |
static auto | write_to_stream (Output &out, memory::basic_span< T, P, S > s) -> auto & |
| Helper function for raw-reading spans into output streams. More...
|
|
template<typename T , typename P , typename S > |
static auto | operator<< (std::ostream &out, memory::basic_span< T, P, S > s) -> std::enable_if_t<!std::is_same_v< std::remove_const_t< T >, char >, std::ostream & > |
| Operator for printing generic element spans into output streams. More...
|
|
template<typename T , typename P , typename S > |
static auto | make_span_getter (span_size_t &i, memory::basic_span< T, P, S > spn) |
| Makes a callable that returns consecutive span elements starting at i. More...
|
|
template<typename T , typename P , typename S , typename Transform > |
static auto | make_span_getter (span_size_t &i, memory::basic_span< T, P, S > spn, Transform transform) |
| Makes a callable getting consecutive, transformed span elements starting at i. More...
|
|
template<typename T , typename P , typename S > |
static auto | make_span_putter (span_size_t &i, memory::basic_span< T, P, S > spn) |
| Makes a callable setting consecutive elements of a span starting at i. More...
|
|
template<typename T , typename P , typename S , typename Transform > |
static auto | make_span_putter (span_size_t &i, memory::basic_span< T, P, S > spn, Transform transform) |
| Makes a callable setting consecutive elements of a span starting at i. More...
|
|