try.hpp 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. /* Try operation macros
  2. (C) 2017-2019 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, ...) BOOST_OUTCOME_TRY_OVERLOAD_GLUE(BOOST_OUTCOME_TRY_OVERLOAD_MACRO(name, BOOST_OUTCOME_TRY_COUNT_ARGS_MAX8(__VA_ARGS__)), (__VA_ARGS__))
  140. #ifndef BOOST_OUTCOME_TRY_LIKELY
  141. #if defined(__clang__) || defined(__GNUC__)
  142. #define BOOST_OUTCOME_TRY_LIKELY(expr) (__builtin_expect(!!(expr), true))
  143. #else
  144. #define BOOST_OUTCOME_TRY_LIKELY(expr) (expr)
  145. #endif
  146. #endif
  147. // Use if(!expr); else as some compilers assume else clauses are always unlikely
  148. #define BOOST_OUTCOME_TRYV2_SUCCESS_LIKELY(unique, ...) \
  149. auto &&unique = (__VA_ARGS__); \
  150. if(BOOST_OUTCOME_TRY_LIKELY(BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(unique))) \
  151. ; \
  152. else \
  153. return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(unique) &&>(unique))
  154. #define BOOST_OUTCOME_TRY2_SUCCESS_LIKELY(unique, v, ...) \
  155. BOOST_OUTCOME_TRYV2_SUCCESS_LIKELY(unique, __VA_ARGS__); \
  156. auto && v = BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(unique) &&>(unique))
  157. #define BOOST_OUTCOME_TRYV2_FAILURE_LIKELY(unique, ...) \
  158. auto &&unique = (__VA_ARGS__); \
  159. if(BOOST_OUTCOME_TRY_LIKELY(!BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(unique))) \
  160. return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(unique) &&>(unique))
  161. #define BOOST_OUTCOME_TRY2_FAILURE_LIKELY(unique, v, ...) \
  162. BOOST_OUTCOME_TRYV2_FAILURE_LIKELY(unique, __VA_ARGS__); \
  163. auto && v = BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(unique) &&>(unique))
  164. #define BOOST_OUTCOME_CO_TRYV2_SUCCESS_LIKELY(unique, ...) \
  165. auto &&unique = (__VA_ARGS__); \
  166. if(BOOST_OUTCOME_TRY_LIKELY(BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(unique))) \
  167. ; \
  168. else \
  169. co_return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(unique) &&>(unique))
  170. #define BOOST_OUTCOME_CO_TRY2_SUCCESS_LIKELY(unique, v, ...) \
  171. BOOST_OUTCOME_CO_TRYV2_SUCCESS_LIKELY(unique, __VA_ARGS__); \
  172. auto && v = BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(unique) &&>(unique))
  173. #define BOOST_OUTCOME_CO_TRYV2_FAILURE_LIKELY(unique, ...) \
  174. auto &&unique = (__VA_ARGS__); \
  175. if(BOOST_OUTCOME_TRY_LIKELY(!BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(unique))) \
  176. co_return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(unique) &&>(unique))
  177. #define BOOST_OUTCOME_CO_TRY2_FAILURE_LIKELY(unique, v, ...) \
  178. BOOST_OUTCOME_CO_TRYV2_FAILURE_LIKELY(unique, __VA_ARGS__); \
  179. auto && v = BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(unique) &&>(unique))
  180. /*! AWAITING HUGO JSON CONVERSION TOOL
  181. SIGNATURE NOT RECOGNISED
  182. */
  183. #define BOOST_OUTCOME_TRYV(...) BOOST_OUTCOME_TRYV2_SUCCESS_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, __VA_ARGS__)
  184. /*! AWAITING HUGO JSON CONVERSION TOOL
  185. SIGNATURE NOT RECOGNISED
  186. */
  187. #define BOOST_OUTCOME_TRYV_FAILURE_LIKELY(...) BOOST_OUTCOME_TRYV2_FAILURE_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, __VA_ARGS__)
  188. /*! AWAITING HUGO JSON CONVERSION TOOL
  189. SIGNATURE NOT RECOGNISED
  190. */
  191. #define BOOST_OUTCOME_CO_TRYV(...) BOOST_OUTCOME_CO_TRYV2_SUCCESS_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, __VA_ARGS__)
  192. /*! AWAITING HUGO JSON CONVERSION TOOL
  193. SIGNATURE NOT RECOGNISED
  194. */
  195. #define BOOST_OUTCOME_CO_TRYV_FAILURE_LIKELY(...) BOOST_OUTCOME_CO_TRYV2_FAILURE_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, __VA_ARGS__)
  196. #if defined(__GNUC__) || defined(__clang__)
  197. /*! AWAITING HUGO JSON CONVERSION TOOL
  198. SIGNATURE NOT RECOGNISED
  199. */
  200. #define BOOST_OUTCOME_TRYX(...) \
  201. ({ \
  202. auto &&res = (__VA_ARGS__); \
  203. if(BOOST_OUTCOME_TRY_LIKELY(BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(res))) \
  204. ; \
  205. else \
  206. return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(res) &&>(res)); \
  207. BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(res) &&>(res)); \
  208. })
  209. /*! AWAITING HUGO JSON CONVERSION TOOL
  210. SIGNATURE NOT RECOGNISED
  211. */
  212. #define BOOST_OUTCOME_CO_TRYX(...) \
  213. ({ \
  214. auto &&res = (__VA_ARGS__); \
  215. if(BOOST_OUTCOME_TRY_LIKELY(BOOST_OUTCOME_V2_NAMESPACE::try_operation_has_value(res))) \
  216. ; \
  217. else \
  218. co_return BOOST_OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(res) &&>(res)); \
  219. BOOST_OUTCOME_V2_NAMESPACE::try_operation_extract_value(static_cast<decltype(res) &&>(res)); \
  220. })
  221. #endif
  222. /*! AWAITING HUGO JSON CONVERSION TOOL
  223. SIGNATURE NOT RECOGNISED
  224. */
  225. #define BOOST_OUTCOME_TRYA(v, ...) BOOST_OUTCOME_TRY2_SUCCESS_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, v, __VA_ARGS__)
  226. /*! AWAITING HUGO JSON CONVERSION TOOL
  227. SIGNATURE NOT RECOGNISED
  228. */
  229. #define BOOST_OUTCOME_TRYA_FAILURE_LIKELY(v, ...) BOOST_OUTCOME_TRY2_FAILURE_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, v, __VA_ARGS__)
  230. /*! AWAITING HUGO JSON CONVERSION TOOL
  231. SIGNATURE NOT RECOGNISED
  232. */
  233. #define BOOST_OUTCOME_CO_TRYA(v, ...) BOOST_OUTCOME_CO_TRY2_SUCCESS_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, v, __VA_ARGS__)
  234. /*! AWAITING HUGO JSON CONVERSION TOOL
  235. SIGNATURE NOT RECOGNISED
  236. */
  237. #define BOOST_OUTCOME_CO_TRYA_FAILURE_LIKELY(v, ...) BOOST_OUTCOME_CO_TRY2_FAILURE_LIKELY(BOOST_OUTCOME_TRY_UNIQUE_NAME, v, __VA_ARGS__)
  238. #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)
  239. #define BOOST_OUTCOME_TRY_INVOKE_TRY7(a, b, c, d, e, f, g) BOOST_OUTCOME_TRYA(a, b, c, d, e, f, g)
  240. #define BOOST_OUTCOME_TRY_INVOKE_TRY6(a, b, c, d, e, f) BOOST_OUTCOME_TRYA(a, b, c, d, e, f)
  241. #define BOOST_OUTCOME_TRY_INVOKE_TRY5(a, b, c, d, e) BOOST_OUTCOME_TRYA(a, b, c, d, e)
  242. #define BOOST_OUTCOME_TRY_INVOKE_TRY4(a, b, c, d) BOOST_OUTCOME_TRYA(a, b, c, d)
  243. #define BOOST_OUTCOME_TRY_INVOKE_TRY3(a, b, c) BOOST_OUTCOME_TRYA(a, b, c)
  244. #define BOOST_OUTCOME_TRY_INVOKE_TRY2(a, b) BOOST_OUTCOME_TRYA(a, b)
  245. #define BOOST_OUTCOME_TRY_INVOKE_TRY1(a) BOOST_OUTCOME_TRYV(a)
  246. /*! AWAITING HUGO JSON CONVERSION TOOL
  247. SIGNATURE NOT RECOGNISED
  248. */
  249. #define BOOST_OUTCOME_TRY(...) BOOST_OUTCOME_TRY_CALL_OVERLOAD(BOOST_OUTCOME_TRY_INVOKE_TRY, __VA_ARGS__)
  250. #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)
  251. #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)
  252. #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)
  253. #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY5(a, b, c, d, e) BOOST_OUTCOME_TRYA_FAILURE_LIKELY(a, b, c, d, e)
  254. #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY4(a, b, c, d) BOOST_OUTCOME_TRYA_FAILURE_LIKELY(a, b, c, d)
  255. #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY3(a, b, c) BOOST_OUTCOME_TRYA_FAILURE_LIKELY(a, b, c)
  256. #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY2(a, b) BOOST_OUTCOME_TRYA_FAILURE_LIKELY(a, b)
  257. #define BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY1(a) BOOST_OUTCOME_TRYV_FAILURE_LIKELY(a)
  258. /*! AWAITING HUGO JSON CONVERSION TOOL
  259. SIGNATURE NOT RECOGNISED
  260. */
  261. #define BOOST_OUTCOME_TRY_FAILURE_LIKELY(...) BOOST_OUTCOME_TRY_CALL_OVERLOAD(BOOST_OUTCOME_TRY_FAILURE_LIKELY_INVOKE_TRY, __VA_ARGS__)
  262. #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)
  263. #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)
  264. #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY6(a, b, c, d, e, f) BOOST_OUTCOME_CO_TRYA(a, b, c, d, e, f)
  265. #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY5(a, b, c, d, e) BOOST_OUTCOME_CO_TRYA(a, b, c, d, e)
  266. #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY4(a, b, c, d) BOOST_OUTCOME_CO_TRYA(a, b, c, d)
  267. #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY3(a, b, c) BOOST_OUTCOME_CO_TRYA(a, b, c)
  268. #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY2(a, b) BOOST_OUTCOME_CO_TRYA(a, b)
  269. #define BOOST_OUTCOME_CO_TRY_INVOKE_TRY1(a) BOOST_OUTCOME_CO_TRYV(a)
  270. /*! AWAITING HUGO JSON CONVERSION TOOL
  271. SIGNATURE NOT RECOGNISED
  272. */
  273. #define BOOST_OUTCOME_CO_TRY(...) BOOST_OUTCOME_TRY_CALL_OVERLOAD(BOOST_OUTCOME_CO_TRY_INVOKE_TRY, __VA_ARGS__)
  274. /*! AWAITING HUGO JSON CONVERSION TOOL
  275. SIGNATURE NOT RECOGNISED
  276. */
  277. #define BOOST_OUTCOME_TRY(...) BOOST_OUTCOME_TRY_CALL_OVERLOAD(BOOST_OUTCOME_TRY_INVOKE_TRY, __VA_ARGS__)
  278. #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)
  279. #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)
  280. #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)
  281. #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)
  282. #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY4(a, b, c, d) BOOST_OUTCOME_CO_TRYA_FAILURE_LIKELY(a, b, c, d)
  283. #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY3(a, b, c) BOOST_OUTCOME_CO_TRYA_FAILURE_LIKELY(a, b, c)
  284. #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY2(a, b) BOOST_OUTCOME_CO_TRYA_FAILURE_LIKELY(a, b)
  285. #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY1(a) BOOST_OUTCOME_CO_TRYV_FAILURE_LIKELY(a)
  286. /*! AWAITING HUGO JSON CONVERSION TOOL
  287. SIGNATURE NOT RECOGNISED
  288. */
  289. #define BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY(...) BOOST_OUTCOME_TRY_CALL_OVERLOAD(BOOST_OUTCOME_CO_TRY_FAILURE_LIKELY_INVOKE_TRY, __VA_ARGS__)
  290. #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 8
  291. #pragma GCC diagnostic pop
  292. #endif
  293. #endif