]>
Commit | Line | Data |
---|---|---|
92f5a8d4 | 1 | /* Try operation macros |
f67539c2 | 2 | (C) 2017-2020 Niall Douglas <http://www.nedproductions.biz/> (20 commits) |
92f5a8d4 TL |
3 | File Created: July 2017 |
4 | ||
5 | ||
6 | Boost Software License - Version 1.0 - August 17th, 2003 | |
7 | ||
8 | Permission is hereby granted, free of charge, to any person or organization | |
9 | obtaining a copy of the software and accompanying documentation covered by | |
10 | this license (the "Software") to use, reproduce, display, distribute, | |
11 | execute, and transmit the Software, and to prepare derivative works of the | |
12 | Software, and to permit third-parties to whom the Software is furnished to | |
13 | do so, all subject to the following: | |
14 | ||
15 | The copyright notices in the Software and this entire statement, including | |
16 | the above license grant, this restriction and the following disclaimer, | |
17 | must be included in all copies of the Software, in whole or in part, and | |
18 | all derivative works of the Software, unless such copies or derivative | |
19 | works are solely in the form of machine-executable object code generated by | |
20 | a source language processor. | |
21 | ||
22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
24 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT | |
25 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE | |
26 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, | |
27 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
28 | DEALINGS IN THE SOFTWARE. | |
29 | */ | |
30 | ||
31 | #ifndef BOOST_OUTCOME_TRY_HPP | |
32 | #define BOOST_OUTCOME_TRY_HPP | |
33 | ||
34 | #include "success_failure.hpp" | |
35 | ||
36 | BOOST_OUTCOME_V2_NAMESPACE_BEGIN | |
37 | ||
38 | namespace detail | |
39 | { | |
40 | struct has_value_overload | |
41 | { | |
42 | }; | |
43 | struct as_failure_overload | |
44 | { | |
45 | }; | |
46 | struct assume_error_overload | |
47 | { | |
48 | }; | |
49 | struct error_overload | |
50 | { | |
51 | }; | |
52 | struct assume_value_overload | |
53 | { | |
54 | }; | |
55 | struct value_overload | |
56 | { | |
57 | }; | |
58 | BOOST_OUTCOME_TEMPLATE(class T, class R = decltype(std::declval<T>().as_failure())) | |
59 | BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(BOOST_OUTCOME_V2_NAMESPACE::is_failure_type<R>)) | |
60 | constexpr inline bool has_as_failure(int /*unused */) { return true; } | |
61 | template <class T> constexpr inline bool has_as_failure(...) { return false; } | |
62 | BOOST_OUTCOME_TEMPLATE(class T) | |
63 | BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TEXPR(std::declval<T>().assume_error())) | |
64 | constexpr inline bool has_assume_error(int /*unused */) { return true; } | |
65 | template <class T> constexpr inline bool has_assume_error(...) { return false; } | |
66 | BOOST_OUTCOME_TEMPLATE(class T) | |
67 | BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TEXPR(std::declval<T>().error())) | |
68 | constexpr inline bool has_error(int /*unused */) { return true; } | |
69 | template <class T> constexpr inline bool has_error(...) { return false; } | |
70 | BOOST_OUTCOME_TEMPLATE(class T) | |
71 | BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TEXPR(std::declval<T>().assume_value())) | |
72 | constexpr inline bool has_assume_value(int /*unused */) { return true; } | |
73 | template <class T> constexpr inline bool has_assume_value(...) { return false; } | |
74 | BOOST_OUTCOME_TEMPLATE(class T) | |
75 | BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TEXPR(std::declval<T>().value())) | |
76 | constexpr inline bool has_value(int /*unused */) { return true; } | |
77 | template <class T> constexpr inline bool has_value(...) { return false; } | |
78 | } // namespace detail | |
79 | ||
80 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
81 | SIGNATURE NOT RECOGNISED | |
82 | */ | |
83 | BOOST_OUTCOME_TEMPLATE(class T) | |
84 | BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TEXPR(std::declval<T>().has_value())) | |
85 | constexpr inline bool try_operation_has_value(T &&v, detail::has_value_overload = {}) | |
86 | { | |
87 | return v.has_value(); | |
88 | } | |
89 | ||
90 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
91 | SIGNATURE NOT RECOGNISED | |
92 | */ | |
93 | BOOST_OUTCOME_TEMPLATE(class T) | |
94 | BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(detail::has_as_failure<T>(5))) | |
95 | constexpr inline decltype(auto) try_operation_return_as(T &&v, detail::as_failure_overload = {}) | |
96 | { | |
97 | return static_cast<T &&>(v).as_failure(); | |
98 | } | |
99 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
100 | SIGNATURE NOT RECOGNISED | |
101 | */ | |
102 | BOOST_OUTCOME_TEMPLATE(class T) | |
103 | BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(!detail::has_as_failure<T>(5) && detail::has_assume_error<T>(5))) | |
104 | constexpr inline decltype(auto) try_operation_return_as(T &&v, detail::assume_error_overload = {}) | |
105 | { | |
106 | return failure(static_cast<T &&>(v).assume_error()); | |
107 | } | |
108 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
109 | SIGNATURE NOT RECOGNISED | |
110 | */ | |
111 | BOOST_OUTCOME_TEMPLATE(class T) | |
112 | BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(!detail::has_as_failure<T>(5) && !detail::has_assume_error<T>(5) && detail::has_error<T>(5))) | |
113 | constexpr inline decltype(auto) try_operation_return_as(T &&v, detail::error_overload = {}) | |
114 | { | |
115 | return failure(static_cast<T &&>(v).error()); | |
116 | } | |
117 | ||
118 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
119 | SIGNATURE NOT RECOGNISED | |
120 | */ | |
121 | BOOST_OUTCOME_TEMPLATE(class T) | |
122 | BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(detail::has_assume_value<T>(5))) | |
123 | constexpr inline decltype(auto) try_operation_extract_value(T &&v, detail::assume_value_overload = {}) | |
124 | { | |
125 | return static_cast<T &&>(v).assume_value(); | |
126 | } | |
127 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
128 | SIGNATURE NOT RECOGNISED | |
129 | */ | |
130 | BOOST_OUTCOME_TEMPLATE(class T) | |
131 | BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(!detail::has_assume_value<T>(5) && detail::has_value<T>(5))) | |
132 | constexpr inline decltype(auto) try_operation_extract_value(T &&v, detail::value_overload = {}) | |
133 | { | |
134 | return static_cast<T &&>(v).value(); | |
135 | } | |
136 | ||
137 | BOOST_OUTCOME_V2_NAMESPACE_END | |
138 | ||
139 | #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 8 | |
140 | #pragma GCC diagnostic push | |
141 | #pragma GCC diagnostic ignored "-Wparentheses" | |
142 | #endif | |
143 | ||
144 | ||
145 | #define BOOST_OUTCOME_TRY_GLUE2(x, y) x##y | |
146 | #define BOOST_OUTCOME_TRY_GLUE(x, y) BOOST_OUTCOME_TRY_GLUE2(x, y) | |
147 | #define BOOST_OUTCOME_TRY_UNIQUE_NAME BOOST_OUTCOME_TRY_GLUE(_outcome_try_unique_name_temporary, __COUNTER__) | |
148 | ||
149 | #define BOOST_OUTCOME_TRY_RETURN_ARG_COUNT(_1_, _2_, _3_, _4_, _5_, _6_, _7_, _8_, count, ...) count | |
150 | #define BOOST_OUTCOME_TRY_EXPAND_ARGS(args) BOOST_OUTCOME_TRY_RETURN_ARG_COUNT args | |
151 | #define BOOST_OUTCOME_TRY_COUNT_ARGS_MAX8(...) BOOST_OUTCOME_TRY_EXPAND_ARGS((__VA_ARGS__, 8, 7, 6, 5, 4, 3, 2, 1, 0)) | |
152 | #define BOOST_OUTCOME_TRY_OVERLOAD_MACRO2(name, count) name##count | |
153 | #define BOOST_OUTCOME_TRY_OVERLOAD_MACRO1(name, count) BOOST_OUTCOME_TRY_OVERLOAD_MACRO2(name, count) | |
154 | #define BOOST_OUTCOME_TRY_OVERLOAD_MACRO(name, count) BOOST_OUTCOME_TRY_OVERLOAD_MACRO1(name, count) | |
155 | #define BOOST_OUTCOME_TRY_OVERLOAD_GLUE(x, y) x y | |
f67539c2 TL |
156 | #define BOOST_OUTCOME_TRY_CALL_OVERLOAD(name, ...) \ |
157 | BOOST_OUTCOME_TRY_OVERLOAD_GLUE(BOOST_OUTCOME_TRY_OVERLOAD_MACRO(name, BOOST_OUTCOME_TRY_COUNT_ARGS_MAX8(__VA_ARGS__)), (__VA_ARGS__)) | |
92f5a8d4 TL |
158 | |
159 | #ifndef BOOST_OUTCOME_TRY_LIKELY | |
160 | #if defined(__clang__) || defined(__GNUC__) | |
161 | #define BOOST_OUTCOME_TRY_LIKELY(expr) (__builtin_expect(!!(expr), true)) | |
162 | #else | |
163 | #define BOOST_OUTCOME_TRY_LIKELY(expr) (expr) | |
164 | #endif | |
165 | #endif | |
166 | ||
167 | // Use if(!expr); else as some compilers assume else clauses are always unlikely | |
f67539c2 TL |
168 | #define BOOST_OUTCOME_TRYV2_SUCCESS_LIKELY(unique, ...) \ |
169 | auto &&unique = (__VA_ARGS__); \ | |
170 | if(BOOST_OUTCOME_TRY_LIKELY(BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(unique))) \ | |
171 | ; \ | |
172 | else \ | |
92f5a8d4 | 173 | return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(unique) &&>(unique)) |
f67539c2 TL |
174 | #define BOOST_OUTCOME_TRY2_SUCCESS_LIKELY(unique, v, ...) \ |
175 | BOOST_OUTCOME_TRYV2_SUCCESS_LIKELY(unique, __VA_ARGS__); \ | |
176 | auto &&v = BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(unique) &&>(unique)) | |
177 | #define BOOST_OUTCOME_TRYV2_FAILURE_LIKELY(unique, ...) \ | |
178 | auto &&unique = (__VA_ARGS__); \ | |
179 | if(BOOST_OUTCOME_TRY_LIKELY(!BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(unique))) \ | |
92f5a8d4 | 180 | return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(unique) &&>(unique)) |
f67539c2 TL |
181 | #define BOOST_OUTCOME_TRY2_FAILURE_LIKELY(unique, v, ...) \ |
182 | BOOST_OUTCOME_TRYV2_FAILURE_LIKELY(unique, __VA_ARGS__); \ | |
183 | auto &&v = BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(unique) &&>(unique)) | |
184 | ||
185 | #define BOOST_OUTCOME_CO_TRYV2_SUCCESS_LIKELY(unique, ...) \ | |
186 | auto &&unique = (__VA_ARGS__); \ | |
187 | if(BOOST_OUTCOME_TRY_LIKELY(BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(unique))) \ | |
188 | ; \ | |
189 | else \ | |
92f5a8d4 | 190 | co_return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(unique) &&>(unique)) |
f67539c2 TL |
191 | #define BOOST_OUTCOME_CO_TRY2_SUCCESS_LIKELY(unique, v, ...) \ |
192 | BOOST_OUTCOME_CO_TRYV2_SUCCESS_LIKELY(unique, __VA_ARGS__); \ | |
193 | auto &&v = BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(unique) &&>(unique)) | |
194 | #define BOOST_OUTCOME_CO_TRYV2_FAILURE_LIKELY(unique, ...) \ | |
195 | auto &&unique = (__VA_ARGS__); \ | |
196 | if(BOOST_OUTCOME_TRY_LIKELY(!BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(unique))) \ | |
92f5a8d4 | 197 | co_return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(unique) &&>(unique)) |
f67539c2 TL |
198 | #define BOOST_OUTCOME_CO_TRY2_FAILURE_LIKELY(unique, v, ...) \ |
199 | BOOST_OUTCOME_CO_TRYV2_FAILURE_LIKELY(unique, __VA_ARGS__); \ | |
200 | auto &&v = BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(unique) &&>(unique)) | |
92f5a8d4 TL |
201 | |
202 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
203 | SIGNATURE NOT RECOGNISED | |
204 | */ | |
205 | #define BOOST_OUTCOME_TRYV(...) BOOST_OUTCOME_TRYV2_SUCCESS_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, __VA_ARGS__) | |
206 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
207 | SIGNATURE NOT RECOGNISED | |
208 | */ | |
209 | #define BOOST_OUTCOME_TRYV_FAILURE_LIKELY(...) BOOST_OUTCOME_TRYV2_FAILURE_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, __VA_ARGS__) | |
210 | ||
211 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
212 | SIGNATURE NOT RECOGNISED | |
213 | */ | |
214 | #define BOOST_OUTCOME_CO_TRYV(...) BOOST_OUTCOME_CO_TRYV2_SUCCESS_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, __VA_ARGS__) | |
215 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
216 | SIGNATURE NOT RECOGNISED | |
217 | */ | |
218 | #define BOOST_OUTCOME_CO_TRYV_FAILURE_LIKELY(...) BOOST_OUTCOME_CO_TRYV2_FAILURE_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, __VA_ARGS__) | |
219 | ||
220 | #if defined(__GNUC__) || defined(__clang__) | |
221 | ||
222 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
223 | SIGNATURE NOT RECOGNISED | |
224 | */ | |
f67539c2 TL |
225 | #define BOOST_OUTCOME_TRYX(...) \ |
226 | ({ \ | |
227 | auto &&res = (__VA_ARGS__); \ | |
228 | if(BOOST_OUTCOME_TRY_LIKELY(BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(res))) \ | |
229 | ; \ | |
230 | else \ | |
231 | return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(res) &&>(res)); \ | |
232 | BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(res) &&>(res)); \ | |
92f5a8d4 TL |
233 | }) |
234 | ||
235 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
236 | SIGNATURE NOT RECOGNISED | |
237 | */ | |
f67539c2 TL |
238 | #define BOOST_OUTCOME_CO_TRYX(...) \ |
239 | ({ \ | |
240 | auto &&res = (__VA_ARGS__); \ | |
241 | if(BOOST_OUTCOME_TRY_LIKELY(BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(res))) \ | |
242 | ; \ | |
243 | else \ | |
244 | co_return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(res) &&>(res)); \ | |
245 | BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(res) &&>(res)); \ | |
92f5a8d4 TL |
246 | }) |
247 | #endif | |
248 | ||
249 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
250 | SIGNATURE NOT RECOGNISED | |
251 | */ | |
252 | #define BOOST_OUTCOME_TRYA(v, ...) BOOST_OUTCOME_TRY2_SUCCESS_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, v, __VA_ARGS__) | |
253 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
254 | SIGNATURE NOT RECOGNISED | |
255 | */ | |
256 | #define BOOST_OUTCOME_TRYA_FAILURE_LIKELY(v, ...) BOOST_OUTCOME_TRY2_FAILURE_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, v, __VA_ARGS__) | |
257 | ||
258 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
259 | SIGNATURE NOT RECOGNISED | |
260 | */ | |
261 | #define BOOST_OUTCOME_CO_TRYA(v, ...) BOOST_OUTCOME_CO_TRY2_SUCCESS_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, v, __VA_ARGS__) | |
262 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
263 | SIGNATURE NOT RECOGNISED | |
264 | */ | |
265 | #define BOOST_OUTCOME_CO_TRYA_FAILURE_LIKELY(v, ...) BOOST_OUTCOME_CO_TRY2_FAILURE_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, v, __VA_ARGS__) | |
266 | ||
267 | ||
268 | #define BOOST_OUTCOME_TRY_INVOKE_TRY8(a, b, c, d, e, f, g, h) BOOST_OUTCOME_TRYA(a, b, c, d, e, f, g, h) | |
269 | #define BOOST_OUTCOME_TRY_INVOKE_TRY7(a, b, c, d, e, f, g) BOOST_OUTCOME_TRYA(a, b, c, d, e, f, g) | |
270 | #define BOOST_OUTCOME_TRY_INVOKE_TRY6(a, b, c, d, e, f) BOOST_OUTCOME_TRYA(a, b, c, d, e, f) | |
271 | #define BOOST_OUTCOME_TRY_INVOKE_TRY5(a, b, c, d, e) BOOST_OUTCOME_TRYA(a, b, c, d, e) | |
272 | #define BOOST_OUTCOME_TRY_INVOKE_TRY4(a, b, c, d) BOOST_OUTCOME_TRYA(a, b, c, d) | |
273 | #define BOOST_OUTCOME_TRY_INVOKE_TRY3(a, b, c) BOOST_OUTCOME_TRYA(a, b, c) | |
274 | #define BOOST_OUTCOME_TRY_INVOKE_TRY2(a, b) BOOST_OUTCOME_TRYA(a, b) | |
275 | #define BOOST_OUTCOME_TRY_INVOKE_TRY1(a) BOOST_OUTCOME_TRYV(a) | |
276 | ||
277 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
278 | SIGNATURE NOT RECOGNISED | |
279 | */ | |
280 | #define BOOST_OUTCOME_TRY(...) BOOST_OUTCOME_TRY_CALL_OVERLOAD(BOOST_OUTCOME_TRY_INVOKE_TRY, __VA_ARGS__) | |
281 | ||
282 | #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY8(a, b, c, d, e, f, g, h) BOOST_OUTCOME_TRYA_FAILURE_LIKELY(a, b, c, d, e, f, g, h) | |
283 | #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY7(a, b, c, d, e, f, g) BOOST_OUTCOME_TRYA_FAILURE_LIKELY(a, b, c, d, e, f, g) | |
284 | #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY6(a, b, c, d, e, f) BOOST_OUTCOME_TRYA_FAILURE_LIKELY(a, b, c, d, e, f) | |
285 | #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY5(a, b, c, d, e) BOOST_OUTCOME_TRYA_FAILURE_LIKELY(a, b, c, d, e) | |
286 | #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY4(a, b, c, d) BOOST_OUTCOME_TRYA_FAILURE_LIKELY(a, b, c, d) | |
287 | #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY3(a, b, c) BOOST_OUTCOME_TRYA_FAILURE_LIKELY(a, b, c) | |
288 | #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY2(a, b) BOOST_OUTCOME_TRYA_FAILURE_LIKELY(a, b) | |
289 | #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY1(a) BOOST_OUTCOME_TRYV_FAILURE_LIKELY(a) | |
290 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
291 | SIGNATURE NOT RECOGNISED | |
292 | */ | |
293 | #define BOOST_OUTCOME_TRY_FAILURE_LIKELY(...) BOOST_OUTCOME_TRY_CALL_OVERLOAD(BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY, __VA_ARGS__) | |
294 | ||
295 | #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY8(a, b, c, d, e, f, g, h) BOOST_OUTCOME_CO_TRYA(a, b, c, d, e, f, g, h) | |
296 | #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY7(a, b, c, d, e, f, g) BOOST_OUTCOME_CO_TRYA(a, b, c, d, e, f, g) | |
297 | #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY6(a, b, c, d, e, f) BOOST_OUTCOME_CO_TRYA(a, b, c, d, e, f) | |
298 | #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY5(a, b, c, d, e) BOOST_OUTCOME_CO_TRYA(a, b, c, d, e) | |
299 | #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY4(a, b, c, d) BOOST_OUTCOME_CO_TRYA(a, b, c, d) | |
300 | #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY3(a, b, c) BOOST_OUTCOME_CO_TRYA(a, b, c) | |
301 | #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY2(a, b) BOOST_OUTCOME_CO_TRYA(a, b) | |
302 | #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY1(a) BOOST_OUTCOME_CO_TRYV(a) | |
303 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
304 | SIGNATURE NOT RECOGNISED | |
305 | */ | |
306 | #define BOOST_OUTCOME_CO_TRY(...) BOOST_OUTCOME_TRY_CALL_OVERLOAD(BOOST_OUTCOME_CO_TRY_INVOKE_TRY, __VA_ARGS__) | |
307 | ||
308 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
309 | SIGNATURE NOT RECOGNISED | |
310 | */ | |
311 | #define BOOST_OUTCOME_TRY(...) BOOST_OUTCOME_TRY_CALL_OVERLOAD(BOOST_OUTCOME_TRY_INVOKE_TRY, __VA_ARGS__) | |
312 | ||
313 | #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY8(a, b, c, d, e, f, g, h) BOOST_OUTCOME_CO_TRYA_FAILURE_LIKELY(a, b, c, d, e, f, g, h) | |
314 | #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY7(a, b, c, d, e, f, g) BOOST_OUTCOME_CO_TRYA_FAILURE_LIKELY(a, b, c, d, e, f, g) | |
315 | #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY6(a, b, c, d, e, f) BOOST_OUTCOME_CO_TRYA_FAILURE_LIKELY(a, b, c, d, e, f) | |
316 | #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY5(a, b, c, d, e) BOOST_OUTCOME_CO_TRYA_FAILURE_LIKELY(a, b, c, d, e) | |
317 | #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY4(a, b, c, d) BOOST_OUTCOME_CO_TRYA_FAILURE_LIKELY(a, b, c, d) | |
318 | #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY3(a, b, c) BOOST_OUTCOME_CO_TRYA_FAILURE_LIKELY(a, b, c) | |
319 | #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY2(a, b) BOOST_OUTCOME_CO_TRYA_FAILURE_LIKELY(a, b) | |
320 | #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY1(a) BOOST_OUTCOME_CO_TRYV_FAILURE_LIKELY(a) | |
321 | /*! AWAITING HUGO JSON CONVERSION TOOL | |
322 | SIGNATURE NOT RECOGNISED | |
323 | */ | |
324 | #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY(...) BOOST_OUTCOME_TRY_CALL_OVERLOAD(BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY, __VA_ARGS__) | |
325 | ||
326 | #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 8 | |
327 | #pragma GCC diagnostic pop | |
328 | #endif | |
329 | ||
330 | #endif |