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

Function main

example/error_trace.cpp:105–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105int main()
106{
107 for( int i=0; i!=10; ++i )
108 leaf::try_handle_all(
109 [&]() -> leaf::result<void>
110 {
111 std::cout << "Run # " << i << ": ";
112 BOOST_LEAF_CHECK(f5());
113 std::cout << "Success!" << std::endl;
114 return { };
115 },
116#if ENABLE_ERROR_TRACE // This single #if enables or disables the capturing of the error trace.
117 []( e_error_trace const & tr )
118 {
119 std::cerr << "Error! Trace:" << std::endl << tr;
120 },
121#endif
122 []
123 {
124 std::cerr << "Error!" << std::endl;
125 } );
126 return 0;
127}
128
129////////////////////////////////////////
130

Callers

nothing calls this directly

Calls 2

try_handle_allFunction · 0.85
f5Function · 0.70

Tested by

no test coverage detected