173 return Generator{Handle::from_promise(*
this)};
208 using Handle = std::coroutine_handle<promise_type>;
246 <<
"Generator::iterator::operator++(): cannot advance past end()";
248 if (
handle_.promise().pending_exception)
249 std::rethrow_exception(std::exchange(
handle_.promise().pending_exception,
nullptr));
273 return handle_.promise().current_value;
312 handle_ = std::exchange(
o.handle_, {});
352 if (
handle_.promise().pending_exception)
353 std::rethrow_exception(std::exchange(
handle_.promise().pending_exception,
nullptr));
359 static std::default_sentinel_t
end()
noexcept {
return std::default_sentinel; }
Exception handling system with formatted messages for Aleph-w.
#define ah_domain_error_if(C)
Throws std::domain_error if condition holds.
size_t size_t int32_t value
Single-pass input iterator over the yielded sequence.
std::input_iterator_tag iterator_category
Category.
iterator() noexcept=default
Construct a singular (past-the-end-compatible) iterator.
iterator & operator++()
Resume the coroutine to its next co_yield (pre-increment).
reference operator*() const noexcept
Dereference to the most recently yielded value.
T & reference
Reference type.
bool done() const noexcept
True when the coroutine has run to completion (or was never begun).
std::add_pointer_t< T > pointer
Pointer type.
void operator++(int)
Resume the coroutine to its next co_yield (post-increment).
std::remove_reference_t< T > value_type
Element type.
std::ptrdiff_t difference_type
Distance type.
friend bool operator==(const iterator &it, std::default_sentinel_t) noexcept
Compare against the end sentinel: equal once the sequence is done.
pointer operator->() const noexcept
Member access on the most recently yielded value.
Lazy, single-pass sequence of T values produced by a coroutine.
Generator(const Generator &)=delete
Deleted: a Generator owns a single coroutine frame, which cannot be duplicated.
std::coroutine_handle< promise_type > Handle
static std::default_sentinel_t end() noexcept
End sentinel, per the C++20 sentinel-based range model.
iterator begin() &
Begin iterating: resumes the coroutine to its first co_yield.
Generator & operator=(Generator &&o) noexcept
Move assignment: destroys any owned frame, then steals o's.
Generator(Generator &&o) noexcept
Move constructor: transfers coroutine-frame ownership.
~Generator()
Destroys the coroutine frame, if any, unwinding pending local state inside the (possibly still-suspen...
Generator() noexcept=default
Construct an empty/singular Generator (no coroutine attached).
Generator & operator=(const Generator &)=delete
Deleted: see the copy constructor.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Main namespace for Aleph-w library functions.
and
Check uniqueness with explicit hash + equality functors.
std::decay_t< typename HeadC::Item_Type > T
The promise type the compiler instantiates for a coroutine returning Generator<T>.
Generator get_return_object() noexcept
Construct the Generator<T> handle returned to the caller.
void unhandled_exception() noexcept
Captures an exception thrown in the coroutine body so it can be rethrown from the resuming call (oper...
std::suspend_always yield_value(std::remove_reference_t< T > &&value) noexcept
std::suspend_never await_transform(U &&)=delete
Generators are not awaited on; co_await inside the body is intentionally unsupported to keep Generato...
std::add_pointer_t< T > current_value
static void return_void() noexcept
Generators do not return a value; co_return; (or falling off the end of the body) simply ends the seq...
static std::suspend_always initial_suspend() noexcept
A Generator starts suspended: nothing in the body runs until the first begin()/resume().
std::exception_ptr pending_exception
static std::suspend_always final_suspend() noexcept
Stay suspended at the end so the promise remains valid until the Generator is destroyed.
std::suspend_always yield_value(std::remove_reference_t< T > &value) noexcept
co_yield value; suspends the coroutine and exposes value via current_value until the next resume.