|
pbr-cpp-memory-pool 1.1.2
Fixed-block-size O(1) memory pool — C++17 with an ANSI C public surface
|
Read-only LegacyForwardIterator over the free-list slots. More...
#include <free_list_iterator.hpp>
Public Types | |
| using | iterator_category = std::forward_iterator_tag |
| using | value_type = const void * |
| using | difference_type = std::ptrdiff_t |
| using | pointer = const value_type * |
| using | reference = const value_type & |
Public Member Functions | |
| FreeListIterator () noexcept=default | |
| Construct the end sentinel. | |
| FreeListIterator (const memory_pool_t *pool, const void *current) noexcept | |
Construct an iterator positioned at current within pool's list. | |
| reference | operator* () const noexcept |
| pointer | operator-> () const noexcept |
| FreeListIterator & | operator++ () noexcept |
| Advance to the next free slot (ADR-0019 §2). | |
| const FreeListIterator | operator++ (int) noexcept |
| Post-increment; returns the pre-advance value. | |
| bool | operator== (const FreeListIterator &rhs) const noexcept |
| Two iterators are equal iff they sit on the same slot (end == end). | |
| bool | operator!= (const FreeListIterator &rhs) const noexcept |
| Negation of operator==. | |
Read-only LegacyForwardIterator over the free-list slots.
Dereferencing yields the address of a free slot as const void*. Because that address is the iterator's own state, operator* returns a reference to the stored member — so the type is a genuine forward iterator (with the multi-pass guarantee), not an input-only proxy. The default- constructed iterator (current_ == nullptr) is the end sentinel.
Never mutate the storage a dereferenced pointer addresses — the surface is read-only by construction (ADR-0019 §3).
Definition at line 49 of file free_list_iterator.hpp.
| using it::d4np::memorypool::FreeListIterator::iterator_category = std::forward_iterator_tag |
Definition at line 51 of file free_list_iterator.hpp.
| using it::d4np::memorypool::FreeListIterator::value_type = const void* |
Definition at line 52 of file free_list_iterator.hpp.
| using it::d4np::memorypool::FreeListIterator::difference_type = std::ptrdiff_t |
Definition at line 53 of file free_list_iterator.hpp.
| using it::d4np::memorypool::FreeListIterator::pointer = const value_type* |
Definition at line 54 of file free_list_iterator.hpp.
| using it::d4np::memorypool::FreeListIterator::reference = const value_type& |
Definition at line 55 of file free_list_iterator.hpp.
|
inlinenoexcept |
Construct an iterator positioned at current within pool's list.
Definition at line 61 of file free_list_iterator.hpp.
|
inlinenoexcept |
Definition at line 64 of file free_list_iterator.hpp.
|
inlinenoexcept |
Definition at line 69 of file free_list_iterator.hpp.
|
inlinenoexcept |
Advance to the next free slot (ADR-0019 §2).
Definition at line 74 of file free_list_iterator.hpp.
|
inlinenoexcept |
Post-increment; returns the pre-advance value.
The const return is the cert-dcl21-cpp convention (prevents (it++)++ misuse); the readability-const-return-type check disagrees, so it is suppressed.
Definition at line 85 of file free_list_iterator.hpp.
|
inlinenoexcept |
Two iterators are equal iff they sit on the same slot (end == end).
Definition at line 92 of file free_list_iterator.hpp.
|
inlinenoexcept |
Negation of operator==.
Definition at line 97 of file free_list_iterator.hpp.