Intermediate
C++
Q88 / 100
What is the co_yield expression in C++20?
Correct! Well done.
Incorrect.
The correct answer is B) Suspends the coroutine and produces a value to the caller, forming the basis for lazy generator coroutines
B
Correct Answer
Suspends the coroutine and produces a value to the caller, forming the basis for lazy generator coroutines
Explanation
co_yield x calls promise.yield_value(x), suspending the coroutine. Callers retrieve the value from the promise or via an awaitable returned by the coroutine.
Progress
88/100