try.hpp 20 KB

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