67 template<Type::SafeComponent Component>
68 requires requires(Component& component,
const Component& readonly) {
69 typename Component::value_type;
70 { component.begin() };
74 { readonly.size() } -> Type::ConvertibleTo<std::size_t>;
77 using InnerIterator =
decltype(std::declval<Component&>().begin());
78 using InnerConstIterator =
decltype(std::declval<const Component&>().begin());
85 static constexpr bool random_access = std::random_access_iterator<InnerIterator>;
92 template<
bool IsConst>
94 using Inner = std::conditional_t<IsConst, InnerConstIterator, InnerIterator>;
97 using iterator_category = std::conditional_t<random_access, std::random_access_iterator_tag, std::bidirectional_iterator_tag>;
113 template<
bool OtherConst>
114 requires IsConst && (!OtherConst)
182 return cursor + offset;
197 template<
bool OtherConst>
205 template<
bool OtherConst>
213 template<
bool OtherConst>
221 template<
bool OtherConst>
229 template<
bool OtherConst>
237 template<
bool OtherConst>
372 template<SafeComponent Component>
373 requires IsSafe<std::remove_const_t<Component>>::value
380 template<SafeComponent Component>
388 template<SafeComponent Component>
Suite cursor.
Definition iterable.hxx:93
bool operator<=(const BasicIterator< OtherConst > &other) const
Order two cursors.
BasicIterator()=default
Construct a singular cursor.
difference_type operator-(const BasicIterator< OtherConst > &other) const
Return the distance to another cursor.
BasicIterator & operator+=(difference_type offset)
Advance by an offset.
BasicIterator & operator--()
Move to the previous element.
bool operator>=(const BasicIterator< OtherConst > &other) const
Order two cursors.
reference operator*() const
Return the current element.
typename Iterable::value_type value_type
Element type.
Definition iterable.hxx:99
friend BasicIterator operator+(difference_type offset, const BasicIterator &cursor)
Advance a cursor from the offset.
Definition iterable.hxx:181
bool operator==(const BasicIterator< OtherConst > &other) const
Compare cursor position.
friend class BasicIterator
Definition iterable.hxx:242
std::conditional_t< random_access, std::random_access_iterator_tag, std::bidirectional_iterator_tag > iterator_category
Iterator category.
Definition iterable.hxx:97
bool operator>(const BasicIterator< OtherConst > &other) const
Order two cursors.
void pointer
The cursor does not expose a raw component pointer.
Definition iterable.hxx:102
bool operator<(const BasicIterator< OtherConst > &other) const
Order two cursors.
&&!OtherConst BasicIterator(const BasicIterator< OtherConst > &other) noexcept
Convert a mutable cursor to a read-only cursor.
BasicIterator operator+(difference_type offset) const
Return the cursor advanced by an offset.
BasicIterator operator++(int)
Advance one element.
reference operator[](difference_type offset) const
Return the element at an offset.
std::ptrdiff_t difference_type
Cursor distance type.
Definition iterable.hxx:100
iterator_category iterator_concept
C++20 iterator concept.
Definition iterable.hxx:98
BasicIterator & operator++()
Advance one element.
BasicIterator & operator-=(difference_type offset)
Retreat by an offset.
friend class Iterable
Definition iterable.hxx:241
BasicIterator operator-(difference_type offset) const
Return the cursor retreated by an offset.
decltype(*std::declval< Inner >()) reference
Element reference.
Definition iterable.hxx:101
BasicIterator operator--(int)
Move to the previous element.
~Iterable()=default
Destroy the component through its Safe operations.
static constexpr bool random_access
Whether the suite selects the index cursor.
Definition iterable.hxx:85
const_iterator cbegin() const noexcept
Return a read-only cursor to the first element.
BasicIterator< false > iterator
Mutable cursor.
Definition iterable.hxx:253
Iterable(Iterable &&other) noexcept=default
Move the component.
BasicIterator< true > const_iterator
Read-only cursor.
Definition iterable.hxx:254
size_type size() const noexcept
Return the element count.
Iterable(const Iterable &other)=default
Copy the component.
iterator end() noexcept
Return the mutable end cursor.
const_iterator cend() const noexcept
Return the read-only end cursor.
container_type m_container
Stored Safe component. This is the only storage.
Definition iterable.hxx:359
typename container_type::value_type value_type
Element type.
Definition iterable.hxx:82
container_type & Container() noexcept
Return the stored component.
Iterable(container_type container) noexcept
Take ownership of an existing component.
Iterable & operator=(const Iterable &other)=default
Copy-assign the component.
bool empty() const noexcept
Test whether the component has no elements.
Component container_type
Wrapped Safe component.
Definition iterable.hxx:81
iterator begin() noexcept
Return a mutable cursor to the first element.
Iterable()=default
Construct an empty component.
Iterable & operator=(Iterable &&other) noexcept=default
Move-assign the component.
Size size_type
Element count. Size, not std::size_t.
Definition iterable.hxx:83
std::ptrdiff_t difference_type
Cursor distance type.
Definition iterable.hxx:84
Count of abstract units (uint64_t storage).
Definition size.hxx:107
Recognizes a conditional Safe component after stripping cv and references.
Definition safe.hxx:301
Owned values that cross a DLL without the caller's CRT.
Root namespace of the StormByte suite.
Octet count. Defined in byte_size.hxx. Forwarded so Type::Numeral can name it.
Host-width-stable count (uint64_t), implicit only to std::size_t.
Recognizes types whose DLL-boundary safety depends on documented provider requirements.
Definition safe.hxx:262
Recognizes collection values with Base-controlled lifetime.
Definition safe.hxx:347
Recognizes Base Safe components, not universal ABI compatibility.
Definition safe.hxx:138
#define STORMBYTE_PUBLIC_TYPE
Definition visibility.h:57