15 template<ice::concepts::ContiguousContainer Self>
18 return self.data()[0];
21 template<ice::concepts::ContiguousContainer Self>
24 return self.data()[self.size() - 1];
28 template<ice::concepts::ContiguousContainer Self>
37 ice::ncount const remaining_count = item_count - from_start;
38 return { self.data() + from_start.
native(),
count.min_value_or(remaining_count, remaining_count)};
41 template<ice::concepts::ContiguousContainer Self>
47 return self.subspan(refval.offset, refval.size);
50 template<ice::concepts::ContiguousContainer Self>
57 return { self.data(),
count.min_value_or(self.size(), 0_count) };
60 template<ice::concepts::ContiguousContainer Self>
70 return { self.data() + offset, max_offset - offset };
74 template<ice::concepts::ContiguousContainer Self>
77 return { self.data() };
80 template<ice::concepts::ContiguousContainer Self>
83 return { self.data() + self.size() };
86 template<ice::concepts::ContiguousContainer Self>
92 template<ice::concepts::ContiguousContainer Self>
99 template<ice::concepts::ContiguousContainer Self>
104 auto const* data_ptr = self.data();
108 if (data_ptr[idx] == value)
118 constexpr auto index_of(
this Self
const& self, Predicate
const& predicate, Args
const&... args)
noexcept ->
ice::nindex
122 auto const* data_ptr = self.data();
126 if (predicate(data_ptr[idx], args...))
136 template<ice::concepts::ContiguousContainer Self>
139 return self.data()[index];
143 template<ice::concepts::ContiguousContainer Self>
Definition container_concepts.hxx:59
Definition container_concepts.hxx:75
Definition associative_container.hxx:8
ice::Span< ice::container::ConstCorrectContainerValueType< ContainerT > > SpanType
Definition container_concepts.hxx:167
ConstCorrectContainerReverseIterator< ContainerT > ReverseIterator
Definition container_concepts.hxx:161
ConstCorrectContainerIterator< ContainerT > Iterator
Definition container_concepts.hxx:158
ValueType< ContainerT > & ValueRef
Definition container_concepts.hxx:149
constexpr auto min(arr_t< Size, T > left, arr_t< Size, U > right) noexcept -> arr_t< Size, T >
Definition array_operations.hxx:60
SPDX-License-Identifier: MIT.
Definition array.hxx:12
auto memset(ice::Memory memory, ice::u8 value) noexcept -> ice::Memory
constexpr ice::ualign align_of
Definition mem_info.hxx:15
constexpr auto count(T const (&)[Size]) noexcept -> ice::u32
Definition base.hxx:43
std::uint32_t u32
Definition types.hxx:26
constexpr ice::meminfo meminfo_of
Definition mem_info.hxx:18
static constexpr ice::ncount_invalid_t ncount_none
Definition ncount.hxx:60
std::uint8_t u8
Definition types.hxx:24
static constexpr ice::nindex_invalid_t nindex_none
Definition nindex.hxx:56
Definition mem_memory.hxx:13
ice::usize size
Definition mem_memory.hxx:15
void * location
Definition mem_memory.hxx:14
Definition basic_container.hxx:11
Definition contiguous_container.hxx:14
constexpr auto tailspan(this Self &&self, ice::nindex offset=1) noexcept -> ice::container::SpanType< Self >
Definition contiguous_container.hxx:61
constexpr auto index_of(this Self const &self, ice::container::ValueRef< Self > value) noexcept -> ice::nindex
Definition contiguous_container.hxx:100
constexpr auto index_of(this Self const &self, Predicate const &predicate, Args const &... args) noexcept -> ice::nindex
Definition contiguous_container.hxx:118
constexpr auto last(this Self &&self) noexcept -> ice::container::ValueRef< Self >
Definition contiguous_container.hxx:22
constexpr auto headspan(this Self &&self, ice::ncount count=1) noexcept -> ice::container::SpanType< Self >
Definition contiguous_container.hxx:51
auto meminfo(this Self const &self) noexcept -> ice::meminfo
Definition contiguous_container.hxx:144
constexpr auto operator[](this Self &&self, ice::nindex index) noexcept -> ice::container::ValueRef< Self >
Definition contiguous_container.hxx:137
constexpr auto rbegin(this Self &&self) noexcept -> ice::container::ReverseIterator< Self >
Definition contiguous_container.hxx:87
constexpr auto begin(this Self &&self) noexcept -> ice::container::Iterator< Self >
Definition contiguous_container.hxx:75
constexpr auto rend(this Self &&self) noexcept -> ice::container::ReverseIterator< Self >
Definition contiguous_container.hxx:93
constexpr auto subspan(this Self &&self, ice::nindex from, ice::ncount count=ice::ncount_none) noexcept -> ice::container::SpanType< Self >
Definition contiguous_container.hxx:29
constexpr auto subspan(this Self &&self, ice::ref32 refval) noexcept -> ice::container::SpanType< Self >
Definition contiguous_container.hxx:42
constexpr auto end(this Self &&self) noexcept -> ice::container::Iterator< Self >
Definition contiguous_container.hxx:81
auto memset(this Self const &self, ice::u8 value) noexcept -> ice::Memory
Definition contiguous_container.hxx:150
constexpr auto first(this Self &&self) noexcept -> ice::container::ValueRef< Self >
Definition contiguous_container.hxx:16
Definition contiguous_container.hxx:11
Definition mem_size_types.hxx:59
constexpr auto min_value_or(this Self self, ice::concepts::NValueCompatibleType auto other, ice::concepts::NValueCompatibleType auto fallback) noexcept
Definition nvalue.hxx:95
constexpr bool is_valid(this Self self) noexcept
Definition nvalue.hxx:86
constexpr auto native() const noexcept
Definition nvalue.hxx:109
Holds 'offset' and 'size' fields (u32) to access data stored in a buffer-like object.
Definition ref.hxx:12
base_type value
Definition mem_size_types.hxx:35