Gives a Safe component the iterators of its category. More...
#include <StormByte/safe/iterable.hxx>

Classes | |
| class | BasicIterator |
| Suite cursor. More... | |
Public Types | |
| using | container_type = Component |
| Wrapped Safe component. | |
| using | value_type = typename container_type::value_type |
| Element type. | |
| using | size_type = Size |
| Element count. Size, not std::size_t. | |
| using | difference_type = std::ptrdiff_t |
| Cursor distance type. | |
| using | iterator = BasicIterator<false> |
| Mutable cursor. | |
| using | const_iterator = BasicIterator<true> |
| Read-only cursor. | |
Public Member Functions | |
| Iterable ()=default | |
| Construct an empty component. | |
| Iterable (const Iterable &other)=default | |
| Copy the component. | |
| Iterable (Iterable &&other) noexcept=default | |
| Move the component. | |
| Iterable (container_type container) noexcept | |
| Take ownership of an existing component. | |
| ~Iterable ()=default | |
| Destroy the component through its Safe operations. | |
| Iterable & | operator= (const Iterable &other)=default |
| Copy-assign the component. | |
| Iterable & | operator= (Iterable &&other) noexcept=default |
| Move-assign the component. | |
| iterator | begin () noexcept |
| Return a mutable cursor to the first element. | |
| iterator | end () noexcept |
| Return the mutable end cursor. | |
| const_iterator | begin () const noexcept |
| Return a read-only cursor to the first element. | |
| const_iterator | end () const noexcept |
| Return the read-only end cursor. | |
| const_iterator | cbegin () const noexcept |
| Return a read-only cursor to the first element. | |
| const_iterator | cend () const noexcept |
| Return the read-only end cursor. | |
| bool | empty () const noexcept |
| Test whether the component has no elements. | |
| size_type | size () const noexcept |
| Return the element count. | |
Static Public Attributes | |
| static constexpr bool | random_access = std::random_access_iterator<InnerIterator> |
| Whether the suite selects the index cursor. | |
Protected Member Functions | |
| container_type & | Container () noexcept |
| Return the stored component. | |
| const container_type & | Container () const noexcept |
| Return the stored component. | |
Protected Attributes | |
| container_type | m_container {} |
| Stored Safe component. This is the only storage. | |
Gives a Safe component the iterators of its category.
| Component | Safe component that already stores the elements. |
The derived type does not write cursors and does not keep a second container. m_container is the storage. A random-access component gets an index cursor. A bidirectional component gets an ordered cursor. A type that is not a Safe component is rejected. A maybe-safe mark is the consumer's promise that its own allocations stay on Base's heap.
| using StormByte::Safe::Iterable< Component >::const_iterator = BasicIterator<true> |
Read-only cursor.
| using StormByte::Safe::Iterable< Component >::container_type = Component |
Wrapped Safe component.
| using StormByte::Safe::Iterable< Component >::difference_type = std::ptrdiff_t |
Cursor distance type.
| using StormByte::Safe::Iterable< Component >::iterator = BasicIterator<false> |
Mutable cursor.
| using StormByte::Safe::Iterable< Component >::size_type = Size |
Element count. Size, not std::size_t.
| using StormByte::Safe::Iterable< Component >::value_type = typename container_type::value_type |
Element type.
|
default |
Construct an empty component.
|
default |
Copy the component.
| other | Source. |
|
defaultnoexcept |
Move the component.
other is left empty.
| other | Source. |
|
explicitnoexcept |
Take ownership of an existing component.
| container | Component to store. |
|
default |
Destroy the component through its Safe operations.
|
noexcept |
Return a read-only cursor to the first element.
|
noexcept |
Return a mutable cursor to the first element.
|
noexcept |
Return a read-only cursor to the first element.
|
noexcept |
Return the read-only end cursor.
|
protectednoexcept |
Return the stored component.
|
protectednoexcept |
Return the stored component.
|
noexcept |
Test whether the component has no elements.
|
noexcept |
Return the read-only end cursor.
|
noexcept |
Return the mutable end cursor.
|
default |
Copy-assign the component.
| other | Source. |
|
defaultnoexcept |
Move-assign the component.
other is left empty.
| other | Source. |
|
noexcept |
Return the element count.
|
protected |
Stored Safe component. This is the only storage.
|
staticconstexpr |
Whether the suite selects the index cursor.