P3950R1 — return_value & return_void Are Not Mutually Exclusive
Robert Leahy
CWG
Revisions R1Jul 2026R0Jan 2026
The standard specifies the effect of `co_return` statements in terms of equivalent statements within the context of a *replacement body* (§9.6.4 [dcl.fct.def.coroutine]). Like a regular `return` statement `co_return` statements have two distinct forms: Those that return `void` and those that return some value. These are specified as follows (§8.8.5 [stmt.return.coroutine]):