requires std::same_as<typename std::generator<T2, V2, Alloc2>::yielded,
yielded>
auto yield_value( ranges::elements_of<std::generator<T2, V2, Alloc2>&&,
requires std::same_as<typename std::generator<T2, V2, Alloc2>::yielded,
yielded>
auto yield_value( ranges::elements_of<std::generator<T2, V2, Alloc2>&,
An implementation of coroutine interface functions used internally to support operator co_yield.
(yielded is a reference type defined in std::generator.)
3, 4)Let
xbe some
generatorobject.
Returns an awaitable object of an unspecified type into which g.range is moved,
active_
andThe coroutine referred to by g.range.coroutine_ must be suspended at its initial suspend point. Otherwise the behavior is undefined.
2,3)A handle referring to the coroutine whose promise object is
*thismust be at the top of
*active_
of some generator object. Otherwise, the behavior is undefined.
[edit] Parameters val - a value which is a result of the yield-expression evaluation lval - an lvalue which is a result of the yield-expression evaluation g - a range of elements produced by a generator r - a range of elements [edit] Return value2-5) An awaitable object of an unspecified type as described above.
[edit] Exceptions2,5) May throw any exception thrown by the initialization of the stored object.
[edit] Example [edit] Defect reportsThe following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior LWG 3899 C++23yield_value
on a range of elements produced by lvalue generator
elements_of
overload used special elements_of
overload for such generators LWG 4119 C++23 range_value_t
in generator
's template argument as part
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4