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

Function main

test/handle_basic_test.cpp:101–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101int main()
102{
103 {
104 int r = leaf::try_handle_all(
105 []() -> leaf::result<int>
106 {
107 return leaf::try_handle_some(
108 []() -> leaf::result<int>
109 {
110 return leaf::try_handle_some(
111 []() -> leaf::result<int>
112 {
113 return leaf::new_error(40);
114 },
115 []( leaf::error_info const & ei, int & v )
116 {
117 ++v;
118 return ei.error();
119 });
120 },
121 []( leaf::error_info const & ei, int & v )
122 {
123 ++v;
124 return ei.error();
125 });
126 },
127 []( int v )
128 {
129 BOOST_TEST_EQ(v, 42);
130 return 1;
131 },
132 []
133 {
134 return 2;
135 });
136 BOOST_TEST_EQ(r, 1);
137 }
138 {
139 int r = leaf::try_handle_all(
140 []() -> leaf::result<int>
141 {
142 return leaf::try_handle_some(
143 []() -> leaf::result<int>
144 {
145 return leaf::try_handle_some(
146 []() -> leaf::result<int>
147 {
148 return leaf::new_error(40);
149 },
150 []( leaf::error_info const & ei, int * v )
151 {
152 ++*v;
153 return ei.error();
154 });
155 },
156 []( leaf::error_info const & ei, int * v )
157 {
158 ++*v;

Callers

nothing calls this directly

Calls 9

try_handle_allFunction · 0.85
try_handle_someFunction · 0.85
new_errorFunction · 0.85
handle_some_errorsFunction · 0.85
handle_some_errors_floatFunction · 0.85
handle_some_errors_voidFunction · 0.85
report_errorsFunction · 0.85
loadMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected