MCPcopy Create free account
hub / github.com/boostorg/cobalt / stackful_task

Function stackful_task

test/experimental/context.cpp:30–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30int stackful_task(experimental::context<task<int>> c, int init)
31{
32 static_assert(experimental::detail::has_await_transform<decltype(c)::promise_type>);
33 BOOST_CHECK(c.await(this_coro::executor) == c.promise().get_executor());
34
35 bool done = false;
36 boost::asio::post(c.promise().get_executor(),
37 [&]{done = true;});
38
39 BOOST_CHECK(!done);
40 c.await(boost::asio::post(use_op));
41 BOOST_CHECK(done);
42 return init * 2;
43}
44
45CO_TEST_CASE(task_)
46{

Callers

nothing calls this directly

Calls 3

awaitMethod · 0.80
get_executorMethod · 0.45
promiseMethod · 0.45

Tested by

no test coverage detected