| 28 | } |
| 29 | |
| 30 | int main() |
| 31 | { |
| 32 | leaf::context<info<1>> ctx; |
| 33 | |
| 34 | { |
| 35 | leaf::result<int> r1 = f(ctx); |
| 36 | BOOST_TEST(!r1); |
| 37 | |
| 38 | leaf::result<int> r2 = ctx.handle_error<leaf::result<int>>( |
| 39 | r1.error(), |
| 40 | []( info<1> x ) -> leaf::result<int> |
| 41 | { |
| 42 | BOOST_TEST_EQ(x.value, 1); |
| 43 | return 1; |
| 44 | }, |
| 45 | [&r1] |
| 46 | { |
| 47 | return std::move(r1); |
| 48 | } ); |
| 49 | BOOST_TEST_EQ(r2.value(), 1); |
| 50 | } |
| 51 | |
| 52 | return boost::report_errors(); |
| 53 | } |
nothing calls this directly
no test coverage detected