All challenges
Multiple ChoiceHard 45s

Coroutine Frame Lifetime and Destruction

In C++20, when is the coroutine frame for a coroutine created via `co_await` on a suspended caller typically destroyed?
Options
  1. 1When the coroutine reaches its final suspend or is otherwise destroyed, via the promise's destroy path
  2. 2Immediately when the coroutine reaches its first suspension point after being resumed
  3. 3At program exit, because coroutine frames are given static storage duration by the compiler
  4. 4When the caller's scope ends, regardless of how far the coroutine has actually progressed

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle