MCPcopy Create free account
hub / github.com/boostorg/asio / coroutine_using_async_ops_2

Function coroutine_using_async_ops_2

test/spawn.cpp:356–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

354}
355
356int coroutine_using_async_ops_2(boost::asio::yield_context yield)
357{
358 using namespace archetypes;
359
360 try
361 {
362 int i;
363 double d;
364 std::tie(i, d) = async_op_2(yield);
365 BOOST_ASIO_CHECK(i == 42);
366 BOOST_ASIO_CHECK(d == 2.0);
367 }
368 catch (...)
369 {
370 BOOST_ASIO_CHECK(false);
371 }
372
373 try
374 {
375 int i;
376 double d;
377 std::tie(i, d) = async_op_ec_2(true, yield);
378 BOOST_ASIO_CHECK(i == 42);
379 BOOST_ASIO_CHECK(d == 2.0);
380 }
381 catch (...)
382 {
383 BOOST_ASIO_CHECK(false);
384 }
385
386 try
387 {
388 std::tuple<int, double> t = async_op_ec_2(false, yield);
389 BOOST_ASIO_CHECK(false);
390 (void)t;
391 }
392 catch (boost::system::system_error& e)
393 {
394 BOOST_ASIO_CHECK(e.code() == boost::asio::error::operation_aborted);
395 }
396 catch (...)
397 {
398 BOOST_ASIO_CHECK(false);
399 }
400
401 try
402 {
403 int i;
404 double d;
405 std::tie(i, d) = async_op_ex_2(true, yield);
406 BOOST_ASIO_CHECK(i == 42);
407 BOOST_ASIO_CHECK(d == 2.0);
408 }
409 catch (...)
410 {
411 BOOST_ASIO_CHECK(false);
412 }
413

Callers

nothing calls this directly

Calls 5

async_op_2Function · 0.85
async_op_ec_2Function · 0.85
async_op_ex_2Function · 0.85
stringFunction · 0.85
codeMethod · 0.80

Tested by

no test coverage detected