wwa-coro 0.0.1
Yet Another C++20 Coroutine Library
|
An input iterator that produces values of type Result
.
More...
#include <generator.h>
Public Types | |
using | difference_type = std::ptrdiff_t |
Difference between the addresses of any two elements in the controlled sequence. | |
using | iterator_concept = std::input_iterator_tag |
The strongest iterator concept supported by the iterator. | |
Public Member Functions | |
iterator () noexcept=default | |
Default constructor. | |
promise_type::reference_type | operator* () const |
Dereferences the iterator to obtain the current value. | |
iterator & | operator++ () |
Advances the iterator to the next value. | |
void | operator++ (int) |
Advances the iterator to the next value. | |
constexpr bool | operator== (const iterator &other) const noexcept |
Compares two iterators. | |
An input iterator that produces values of type Result
.
The iterator is used to traverse the values produced by the generator.
Example (range-based for
):
Example (manual iteration):
Definition at line 224 of file generator.h.
using wwa::coro::generator< Result >::iterator::difference_type = std::ptrdiff_t |
Difference between the addresses of any two elements in the controlled sequence.
std::ranges::view
concept. It does not really make sense for generators. Definition at line 233 of file generator.h.
using wwa::coro::generator< Result >::iterator::iterator_concept = std::input_iterator_tag |
The strongest iterator concept supported by the iterator.
Definition at line 227 of file generator.h.
|
defaultnoexcept |
Default constructor.
Constructs a sentinel iterator.
std::ranges::view
concept.
|
inline |
Dereferences the iterator to obtain the current value.
This method dereferences the iterator to obtain the current value produced by the generator.
bad_result_access | Attempting to dereference the end of the generator. |
Definition at line 321 of file generator.h.
|
inline |
Advances the iterator to the next value.
This method advances the iterator to the next value produced by the generator.
bad_result_access | Attempt to advance the iterator that has reached the end of the generator. |
Definition at line 286 of file generator.h.
|
inline |
Advances the iterator to the next value.
This method advances the iterator to the next value produced by the generator. It is similar to the prefix increment operator but does not return a reference to the incremented iterator.
std::ranges::view
concept. Definition at line 308 of file generator.h.
|
inlinenodiscardconstexprnoexcept |
Compares two iterators.
Two iterators are equal if they point to the same coroutine or if they are both sentinel iterators.
other | Another iterator. |
true
if the iterators are equal, false
otherwise. Definition at line 269 of file generator.h.