|
|
Coroutine traits | ||||
(C++20) | ||||
Coroutine handle | ||||
(C++20) | ||||
No-op coroutines | ||||
(C++20) | ||||
(C++20) | ||||
Trivial awaitables | ||||
(C++20) | ||||
(C++20) | ||||
Range generators | ||||
(C++23) |
|
Range primitives | |||||||
|
Range concepts | |||||||||||||||||||
|
Range factories | |||||||||
|
Range adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Helper items | |||||||||||||||||
|
class/*iterator*/; | (exposition only*) | |
The return type ofgenerator::begin
. Modelsindirectly_readable
andinput_iterator
.
Contents |
Member type | Definition |
value_type | std::generator::value |
difference_type | std::ptrdiff_t |
Member | Description |
std::coroutine_handle<std::generator::promise_type>coroutine_ | The coroutine handle (exposition-only member object*) |
constructs an iterator (public member function) | |
assigns another iterator (public member function) | |
returns an underlying value (public member function) | |
advances the iterator (public member function) |
/*iterator*/(/*iterator*/&& other)noexcept; | (since C++23) | |
Initializescoroutine_
withstd::exchange(other.coroutine_,{});.
/*iterator*/& operator=(/*iterator*/&& other)noexcept; | (since C++23) | |
Equivalent tocoroutine_=std::exchange(other.coroutine_,{});.
Returns:*this.
reference operator*()const noexcept(std::is_nothrow_copy_constructible_v<reference>); | (since C++23) | |
reference
be thestd::generator
's underlying type.coroutine_
be in the stack*x.active_.Equivalent toreturnstatic_cast<reference>(*p.value_);.
constexpr/*iterator*/& operator++(); | (1) | (since C++23) |
constexprvoid operator++(int); | (2) | (since C++23) |
(C++23) | compares the underlying iterator with a sentinel (function) |
friendbool operator==(const/*iterator*/& i,std::default_sentinel_t); | (since C++23) | |
Equivalent toreturn i.coroutine_.done();.
The!=
operator issynthesized fromoperator==
.
This function is not visible to ordinaryunqualified orqualified lookup, and can only be found byargument-dependent lookup whenstd::generator::iterator
is an associated class of the arguments.
This section is incomplete Reason: no example |