You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If `dispatch()` posts work rather than dispatching inline, it returns `std::noop_coroutine()`. Calling `.resume()` on this is defined as a no-op, making the API safe in all contexts:
219
+
220
+
```cpp
221
+
coro dispatch(coro h) const
222
+
{
223
+
return h; // Return for symmetric transfer OR explicit resume
224
+
}
225
+
226
+
// Coroutine caller:
227
+
return ex.dispatch(h); // Symmetric transfer
228
+
229
+
// Sender/callback caller:
230
+
ex.dispatch(h).resume(); // Explicit resume, noop if posted
231
+
```
232
+
233
+
This means one executor interface serves both coroutines and senders with no conditional code paths.
234
+
235
+
### 5.3 The Task Type
207
236
208
237
The `task` type represents a lazy, composable coroutine:
209
238
@@ -386,6 +415,7 @@ HALO (Heap Allocation eLision Optimization) can sometimes inline coroutine frame
386
415
| Runtime (deep) | Degrades with type erasure | Stable, scales well |
387
416
| Allocations | 0 (native) to many (erased) | Predictable (1 per coroutine) |
0 commit comments