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

Function task

example/try_capture_all_exceptions.cpp:44–54  ·  view source on GitHub ↗

This is our task function. It produces objects of type task_result, but it may fail.

Source from the content-addressed store, hash-verified

42 // This is our task function. It produces objects of type task_result, but it
43 // may fail.
44task_result task()
45{
46 bool succeed = (rand()%4) != 0; //...at random.
47 if( succeed )
48 return { };
49 else
50 leaf::throw_exception(
51 e_thread_id{std::this_thread::get_id()},
52 e_failure_info1{"info"},
53 e_failure_info2{42} );
54};
55
56int main()
57{

Callers

nothing calls this directly

Calls 1

throw_exceptionFunction · 0.70

Tested by

no test coverage detected