| 30 | }; |
| 31 | |
| 32 | int main() |
| 33 | { |
| 34 | leaf::try_handle_all( |
| 35 | []() -> leaf::result<void> |
| 36 | { |
| 37 | return leaf::try_handle_some( |
| 38 | []() -> leaf::result<void> |
| 39 | { |
| 40 | leaf::try_handle_all( |
| 41 | []() -> leaf::result<void> |
| 42 | { |
| 43 | return leaf::new_error(info<1>{}); |
| 44 | }, |
| 45 | [] |
| 46 | { |
| 47 | } ); |
| 48 | return leaf::new_error(info<2>{}); |
| 49 | }, |
| 50 | []( info<1> ) |
| 51 | { |
| 52 | } ); |
| 53 | }, |
| 54 | []( leaf::diagnostic_details const & di ) |
| 55 | { |
| 56 | #if BOOST_LEAF_CFG_STD_STRING |
| 57 | std::ostringstream st; |
| 58 | st << di; |
| 59 | std::string s = st.str(); |
| 60 | std::cout << s << std::endl; |
| 61 | if( BOOST_LEAF_CFG_DIAGNOSTICS && BOOST_LEAF_CFG_CAPTURE ) |
| 62 | BOOST_TEST_NE(s.find("info<2>"), s.npos); |
| 63 | #endif |
| 64 | } ); |
| 65 | |
| 66 | #ifndef BOOST_LEAF_NO_EXCEPTIONS |
| 67 | |
| 68 | std::cout << __LINE__ << " ----\n"; |
| 69 | |
| 70 | leaf::try_catch( |
| 71 | [] |
| 72 | { |
| 73 | leaf::try_catch( |
| 74 | [] |
| 75 | { |
| 76 | leaf::try_catch( |
| 77 | [] |
| 78 | { |
| 79 | leaf::throw_exception(info<1>{}); |
| 80 | }, |
| 81 | [] |
| 82 | { |
| 83 | } ); |
| 84 | leaf::throw_exception(info<2>{}); |
| 85 | }, |
| 86 | []( info<1> ) |
| 87 | { |
| 88 | } ); |
| 89 | }, |
nothing calls this directly
no test coverage detected