MCPcopy Create free account
hub / github.com/boostorg/leaf / launch_tasks

Function launch_tasks

test/capture_exception_async_test.cpp:47–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46template <class F>
47std::vector<fut_info> launch_tasks( int task_count, F f )
48{
49 BOOST_LEAF_ASSERT(task_count > 0);
50 std::vector<fut_info> fut;
51 std::generate_n( std::back_inserter(fut), task_count,
52 [=]
53 {
54 int const a = rand();
55 int const b = rand();
56 int const res = (rand()%10) - 5;
57 return fut_info { a, b, res, std::async( std::launch::async,
58 [=]
59 {
60 return leaf::try_capture_all(
61 [&]
62 {
63 return f(a, b, res);
64 } );
65 } ) };
66 } );
67 return fut;
68}
69
70int main()
71{

Callers 1

mainFunction · 0.70

Calls 2

try_capture_allFunction · 0.85
fFunction · 0.70

Tested by

no test coverage detected