Imported Upstream version 1.72.0
[platform/upstream/boost.git] / boost / outcome / try.hpp
1 /* Try operation macros
2 (C) 2017-2019 Niall Douglas <http://www.nedproductions.biz/> (20 commits)
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
156 #define BOOST_OUTCOME_TRY_CALL_OVERLOAD(name, ...) BOOST_OUTCOME_TRY_OVERLOAD_GLUE(BOOST_OUTCOME_TRY_OVERLOAD_MACRO(name, BOOST_OUTCOME_TRY_COUNT_ARGS_MAX8(__VA_ARGS__)), (__VA_ARGS__))
157
158 #ifndef BOOST_OUTCOME_TRY_LIKELY
159 #if defined(__clang__) || defined(__GNUC__)
160 #define BOOST_OUTCOME_TRY_LIKELY(expr) (__builtin_expect(!!(expr), true))
161 #else
162 #define BOOST_OUTCOME_TRY_LIKELY(expr) (expr)
163 #endif
164 #endif
165
166 // Use if(!expr); else as some compilers assume else clauses are always unlikely
167 #define BOOST_OUTCOME_TRYV2_SUCCESS_LIKELY(unique, ...)                                                                                                                                                                                                                                                                              \
168   auto &&unique = (__VA_ARGS__);                                                                                                                                                                                                                                                                                               \
169   if(BOOST_OUTCOME_TRY_LIKELY(BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(unique)))                                                                                                                                                                                                                                                \
170     ;                                                                                                                                                                                                                                                                                                                          \
171   else                                                                                                                                                                                                                                                                                                                         \
172     return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(unique) &&>(unique))
173 #define BOOST_OUTCOME_TRY2_SUCCESS_LIKELY(unique, v, ...)                                                                                                                                                                                                                                                                            \
174   BOOST_OUTCOME_TRYV2_SUCCESS_LIKELY(unique, __VA_ARGS__);                                                                                                                                                                                                                                                                           \
175   auto && v = BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(unique) &&>(unique))
176 #define BOOST_OUTCOME_TRYV2_FAILURE_LIKELY(unique, ...)                                                                                                                                                                                                                                                                              \
177   auto &&unique = (__VA_ARGS__);                                                                                                                                                                                                                                                                                               \
178   if(BOOST_OUTCOME_TRY_LIKELY(!BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(unique)))                                                                                                                                                                                                                                               \
179   return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(unique) &&>(unique))
180 #define BOOST_OUTCOME_TRY2_FAILURE_LIKELY(unique, v, ...)                                                                                                                                                                                                                                                                            \
181   BOOST_OUTCOME_TRYV2_FAILURE_LIKELY(unique, __VA_ARGS__);                                                                                                                                                                                                                                                                           \
182   auto && v = BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(unique) &&>(unique))
183
184 #define BOOST_OUTCOME_CO_TRYV2_SUCCESS_LIKELY(unique, ...)                                                                                                                                                                                                                                                                           \
185   auto &&unique = (__VA_ARGS__);                                                                                                                                                                                                                                                                                               \
186   if(BOOST_OUTCOME_TRY_LIKELY(BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(unique)))                                                                                                                                                                                                                                                \
187     ;                                                                                                                                                                                                                                                                                                                          \
188   else                                                                                                                                                                                                                                                                                                                         \
189     co_return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(unique) &&>(unique))
190 #define BOOST_OUTCOME_CO_TRY2_SUCCESS_LIKELY(unique, v, ...)                                                                                                                                                                                                                                                                         \
191   BOOST_OUTCOME_CO_TRYV2_SUCCESS_LIKELY(unique, __VA_ARGS__);                                                                                                                                                                                                                                                                        \
192   auto && v = BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(unique) &&>(unique))
193 #define BOOST_OUTCOME_CO_TRYV2_FAILURE_LIKELY(unique, ...)                                                                                                                                                                                                                                                                           \
194   auto &&unique = (__VA_ARGS__);                                                                                                                                                                                                                                                                                               \
195   if(BOOST_OUTCOME_TRY_LIKELY(!BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(unique)))                                                                                                                                                                                                                                               \
196   co_return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(unique) &&>(unique))
197 #define BOOST_OUTCOME_CO_TRY2_FAILURE_LIKELY(unique, v, ...)                                                                                                                                                                                                                                                                         \
198   BOOST_OUTCOME_CO_TRYV2_FAILURE_LIKELY(unique, __VA_ARGS__);                                                                                                                                                                                                                                                                        \
199   auto && v = BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(unique) &&>(unique))
200
201 /*! AWAITING HUGO JSON CONVERSION TOOL
202 SIGNATURE NOT RECOGNISED
203 */
204 #define BOOST_OUTCOME_TRYV(...) BOOST_OUTCOME_TRYV2_SUCCESS_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, __VA_ARGS__)
205 /*! AWAITING HUGO JSON CONVERSION TOOL
206 SIGNATURE NOT RECOGNISED
207 */
208 #define BOOST_OUTCOME_TRYV_FAILURE_LIKELY(...) BOOST_OUTCOME_TRYV2_FAILURE_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, __VA_ARGS__)
209
210 /*! AWAITING HUGO JSON CONVERSION TOOL
211 SIGNATURE NOT RECOGNISED
212 */
213 #define BOOST_OUTCOME_CO_TRYV(...) BOOST_OUTCOME_CO_TRYV2_SUCCESS_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, __VA_ARGS__)
214 /*! AWAITING HUGO JSON CONVERSION TOOL
215 SIGNATURE NOT RECOGNISED
216 */
217 #define BOOST_OUTCOME_CO_TRYV_FAILURE_LIKELY(...) BOOST_OUTCOME_CO_TRYV2_FAILURE_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, __VA_ARGS__)
218
219 #if defined(__GNUC__) || defined(__clang__)
220
221 /*! AWAITING HUGO JSON CONVERSION TOOL
222 SIGNATURE NOT RECOGNISED
223 */
224 #define BOOST_OUTCOME_TRYX(...)                                                                                                                                                                                                                                                                                                      \
225   ({                                                                                                                                                                                                                                                                                                                           \
226     auto &&res = (__VA_ARGS__);                                                                                                                                                                                                                                                                                                \
227     if(BOOST_OUTCOME_TRY_LIKELY(BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(res)))                                                                                                                                                                                                                                                 \
228       ;                                                                                                                                                                                                                                                                                                                        \
229     else                                                                                                                                                                                                                                                                                                                       \
230       return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(res) &&>(res));                                                                                                                                                                                                                                \
231     BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(res) &&>(res));                                                                                                                                                                                                                                     \
232   })
233
234 /*! AWAITING HUGO JSON CONVERSION TOOL
235 SIGNATURE NOT RECOGNISED
236 */
237 #define BOOST_OUTCOME_CO_TRYX(...)                                                                                                                                                                                                                                                                                                   \
238   ({                                                                                                                                                                                                                                                                                                                           \
239     auto &&res = (__VA_ARGS__);                                                                                                                                                                                                                                                                                                \
240     if(BOOST_OUTCOME_TRY_LIKELY(BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(res)))                                                                                                                                                                                                                                                 \
241       ;                                                                                                                                                                                                                                                                                                                        \
242     else                                                                                                                                                                                                                                                                                                                       \
243       co_return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(res) &&>(res));                                                                                                                                                                                                                             \
244     BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(res) &&>(res));                                                                                                                                                                                                                                     \
245   })
246 #endif
247
248 /*! AWAITING HUGO JSON CONVERSION TOOL
249 SIGNATURE NOT RECOGNISED
250 */
251 #define BOOST_OUTCOME_TRYA(v, ...) BOOST_OUTCOME_TRY2_SUCCESS_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, v, __VA_ARGS__)
252 /*! AWAITING HUGO JSON CONVERSION TOOL
253 SIGNATURE NOT RECOGNISED
254 */
255 #define BOOST_OUTCOME_TRYA_FAILURE_LIKELY(v, ...) BOOST_OUTCOME_TRY2_FAILURE_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, v, __VA_ARGS__)
256
257 /*! AWAITING HUGO JSON CONVERSION TOOL
258 SIGNATURE NOT RECOGNISED
259 */
260 #define BOOST_OUTCOME_CO_TRYA(v, ...) BOOST_OUTCOME_CO_TRY2_SUCCESS_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, v, __VA_ARGS__)
261 /*! AWAITING HUGO JSON CONVERSION TOOL
262 SIGNATURE NOT RECOGNISED
263 */
264 #define BOOST_OUTCOME_CO_TRYA_FAILURE_LIKELY(v, ...) BOOST_OUTCOME_CO_TRY2_FAILURE_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, v, __VA_ARGS__)
265
266
267 #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)
268 #define BOOST_OUTCOME_TRY_INVOKE_TRY7(a, b, c, d, e, f, g) BOOST_OUTCOME_TRYA(a, b, c, d, e, f, g)
269 #define BOOST_OUTCOME_TRY_INVOKE_TRY6(a, b, c, d, e, f) BOOST_OUTCOME_TRYA(a, b, c, d, e, f)
270 #define BOOST_OUTCOME_TRY_INVOKE_TRY5(a, b, c, d, e) BOOST_OUTCOME_TRYA(a, b, c, d, e)
271 #define BOOST_OUTCOME_TRY_INVOKE_TRY4(a, b, c, d) BOOST_OUTCOME_TRYA(a, b, c, d)
272 #define BOOST_OUTCOME_TRY_INVOKE_TRY3(a, b, c) BOOST_OUTCOME_TRYA(a, b, c)
273 #define BOOST_OUTCOME_TRY_INVOKE_TRY2(a, b) BOOST_OUTCOME_TRYA(a, b)
274 #define BOOST_OUTCOME_TRY_INVOKE_TRY1(a) BOOST_OUTCOME_TRYV(a)
275
276 /*! AWAITING HUGO JSON CONVERSION TOOL
277 SIGNATURE NOT RECOGNISED
278 */
279 #define BOOST_OUTCOME_TRY(...) BOOST_OUTCOME_TRY_CALL_OVERLOAD(BOOST_OUTCOME_TRY_INVOKE_TRY, __VA_ARGS__)
280
281 #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)
282 #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)
283 #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)
284 #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY5(a, b, c, d, e) BOOST_OUTCOME_TRYA_FAILURE_LIKELY(a, b, c, d, e)
285 #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY4(a, b, c, d) BOOST_OUTCOME_TRYA_FAILURE_LIKELY(a, b, c, d)
286 #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY3(a, b, c) BOOST_OUTCOME_TRYA_FAILURE_LIKELY(a, b, c)
287 #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY2(a, b) BOOST_OUTCOME_TRYA_FAILURE_LIKELY(a, b)
288 #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY1(a) BOOST_OUTCOME_TRYV_FAILURE_LIKELY(a)
289 /*! AWAITING HUGO JSON CONVERSION TOOL
290 SIGNATURE NOT RECOGNISED
291 */
292 #define BOOST_OUTCOME_TRY_FAILURE_LIKELY(...) BOOST_OUTCOME_TRY_CALL_OVERLOAD(BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY, __VA_ARGS__)
293
294 #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)
295 #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)
296 #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY6(a, b, c, d, e, f) BOOST_OUTCOME_CO_TRYA(a, b, c, d, e, f)
297 #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY5(a, b, c, d, e) BOOST_OUTCOME_CO_TRYA(a, b, c, d, e)
298 #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY4(a, b, c, d) BOOST_OUTCOME_CO_TRYA(a, b, c, d)
299 #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY3(a, b, c) BOOST_OUTCOME_CO_TRYA(a, b, c)
300 #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY2(a, b) BOOST_OUTCOME_CO_TRYA(a, b)
301 #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY1(a) BOOST_OUTCOME_CO_TRYV(a)
302 /*! AWAITING HUGO JSON CONVERSION TOOL
303 SIGNATURE NOT RECOGNISED
304 */
305 #define BOOST_OUTCOME_CO_TRY(...) BOOST_OUTCOME_TRY_CALL_OVERLOAD(BOOST_OUTCOME_CO_TRY_INVOKE_TRY, __VA_ARGS__)
306
307 /*! AWAITING HUGO JSON CONVERSION TOOL
308 SIGNATURE NOT RECOGNISED
309 */
310 #define BOOST_OUTCOME_TRY(...) BOOST_OUTCOME_TRY_CALL_OVERLOAD(BOOST_OUTCOME_TRY_INVOKE_TRY, __VA_ARGS__)
311
312 #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)
313 #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)
314 #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)
315 #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)
316 #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY4(a, b, c, d) BOOST_OUTCOME_CO_TRYA_FAILURE_LIKELY(a, b, c, d)
317 #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY3(a, b, c) BOOST_OUTCOME_CO_TRYA_FAILURE_LIKELY(a, b, c)
318 #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY2(a, b) BOOST_OUTCOME_CO_TRYA_FAILURE_LIKELY(a, b)
319 #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY1(a) BOOST_OUTCOME_CO_TRYV_FAILURE_LIKELY(a)
320 /*! AWAITING HUGO JSON CONVERSION TOOL
321 SIGNATURE NOT RECOGNISED
322 */
323 #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY(...) BOOST_OUTCOME_TRY_CALL_OVERLOAD(BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY, __VA_ARGS__)
324
325 #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 8
326 #pragma GCC diagnostic pop
327 #endif
328
329 #endif