functions.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  3. <title>Functions - Boost.Outcome documentation</title>
  4. <link rel="stylesheet" href="../css/boost.css" type="text/css">
  5. <meta name="generator" content="Hugo 0.52 with Boostdoc theme">
  6. <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
  7. <link rel="icon" href="../images/favicon.ico" type="image/ico"/>
  8. <body><div class="spirit-nav">
  9. <a accesskey="p" href="../reference/aliases/unchecked.html"><img src="../images/prev.png" alt="Prev"></a>
  10. <a accesskey="u" href="../reference.html"><img src="../images/up.png" alt="Up"></a>
  11. <a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../reference/functions/hooks.html"><img src="../images/next.png" alt="Next"></a></div><div id="content">
  12. <div class="titlepage"><div><div><h1 style="clear: both">Functions</h1></div></div></div>
  13. <ol class="children children-li"><li>
  14. <a href="../reference/functions/hooks.html" >Hooks</a>
  15. <p>Functions used to hook into the functionality of <code>basic_result</code> and <code>basic_outcome</code>.</p><ol><li>
  16. <a href="../reference/functions/hooks/spare_storage.html" ><code>uint16_t spare_storage(const basic_result|basic_outcome *) noexcept</code></a>
  17. <p>Returns the sixteen bits of spare storage in the specified result or outcome.</p><li>
  18. <a href="../reference/functions/hooks/hook_outcome_construction.html" ><code>void hook_outcome_construction(T *, U &amp;&amp;) noexcept</code></a>
  19. <p>ADL discovered free function hook invoked by the implicit constructors of <code>basic_outcome</code>.</p><li>
  20. <a href="../reference/functions/hooks/hook_outcome_construction2.html" ><code>void hook_outcome_construction(T *, U &amp;&amp;, V &amp;&amp;) noexcept</code></a>
  21. <p>ADL discovered free function hook invoked by the implicit constructors of <code>basic_outcome</code>.</p><li>
  22. <a href="../reference/functions/hooks/hook_outcome_copy_construction.html" ><code>void hook_outcome_copy_construction(T *, U &amp;&amp;) noexcept</code></a>
  23. <p>ADL discovered free function hook invoked by the converting copy constructors of <code>basic_outcome</code>.</p><li>
  24. <a href="../reference/functions/hooks/hook_outcome_copy_construction2.html" ><code>void hook_outcome_copy_construction(T *, U &amp;&amp;, V &amp;&amp;) noexcept</code></a>
  25. <p>ADL discovered free function hook invoked by the converting copy constructors of <code>basic_outcome</code>.</p><li>
  26. <a href="../reference/functions/hooks/hook_outcome_in_place_construction.html" ><code>void hook_outcome_in_place_construction(T *, in_place_type_t&lt;U&gt;, Args &amp;&amp;...) noexcept</code></a>
  27. <p>ADL discovered free function hook invoked by the in-place constructors of <code>basic_outcome</code>.</p><li>
  28. <a href="../reference/functions/hooks/hook_outcome_move_construction.html" ><code>void hook_outcome_move_construction(T *, U &amp;&amp;) noexcept</code></a>
  29. <p>ADL discovered free function hook invoked by the converting move constructors of <code>basic_outcome</code>.</p><li>
  30. <a href="../reference/functions/hooks/hook_outcome_move_construction2.html" ><code>void hook_outcome_move_construction(T *, U &amp;&amp;, V &amp;&amp;) noexcept</code></a>
  31. <p>ADL discovered free function hook invoked by the converting move constructors of <code>basic_outcome</code>.</p><li>
  32. <a href="../reference/functions/hooks/hook_result_construction.html" ><code>void hook_result_construction(T *, U &amp;&amp;) noexcept</code></a>
  33. <p>ADL discovered free function hook invoked by the implicit constructors of <code>basic_result</code>.</p><li>
  34. <a href="../reference/functions/hooks/hook_result_copy_construction.html" ><code>void hook_result_copy_construction(T *, U &amp;&amp;) noexcept</code></a>
  35. <p>ADL discovered free function hook invoked by the converting copy constructors of <code>basic_result</code>.</p><li>
  36. <a href="../reference/functions/hooks/hook_result_in_place_construction.html" ><code>void hook_result_in_place_construction(T *, in_place_type_t&lt;U&gt;, Args &amp;&amp;...) noexcept</code></a>
  37. <p>ADL discovered free function hook invoked by the in-place constructors of <code>basic_result</code>.</p><li>
  38. <a href="../reference/functions/hooks/hook_result_move_construction.html" ><code>void hook_result_move_construction(T *, U &amp;&amp;) noexcept</code></a>
  39. <p>ADL discovered free function hook invoked by the converting move constructors of <code>basic_result</code>.</p><li>
  40. <a href="../reference/functions/hooks/override_outcome_exception.html" ><code>void override_outcome_exception(basic_outcome&lt;T, EC, EP, NoValuePolicy&gt; *, U &amp;&amp;) noexcept</code></a>
  41. <p>Overrides the exception to something other than what was constructed.</p><li>
  42. <a href="../reference/functions/hooks/set_spare_storage.html" ><code>void set_spare_storage(basic_result|basic_outcome *, uint16_t) noexcept</code></a>
  43. <p>Sets the sixteen bits of spare storage in the specified result or outcome.</p></li></ol><li>
  44. <a href="../reference/functions/iostream.html" >Iostream</a>
  45. <p>Functions used to print, serialise and deserialise <code>basic_result</code> and <code>basic_outcome</code>.</p><ol><li>
  46. <a href="../reference/functions/iostream/outcome_operator_in.html" ><code>std::istream &amp;operator&gt;&gt;(std::istream &amp;, basic_outcome&lt;T, EC, EP, NoValuePolicy&gt; &amp;)</code></a>
  47. <p>Deserialises a <code>basic_outcome</code> from a <code>std::istream</code>.</p><li>
  48. <a href="../reference/functions/iostream/result_operator_in.html" ><code>std::istream &amp;operator&gt;&gt;(std::istream &amp;, basic_result&lt;T, E, NoValuePolicy&gt; &amp;)</code></a>
  49. <p>Deserialises a <code>basic_result</code> from a <code>std::istream</code>.</p><li>
  50. <a href="../reference/functions/iostream/outcome_operator_out.html" ><code>std::ostream &amp;operator&lt;&lt;(std::ostream &amp;, const basic_outcome&lt;T, EC, EP, NoValuePolicy&gt; &amp;)</code></a>
  51. <p>Serialises a <code>basic_outcome</code> to a <code>std::ostream</code>.</p><li>
  52. <a href="../reference/functions/iostream/result_operator_out.html" ><code>std::ostream &amp;operator&lt;&lt;(std::ostream &amp;, const basic_result&lt;T, E, NoValuePolicy&gt; &amp;)</code></a>
  53. <p>Serialises a <code>basic_result</code> to a <code>std::ostream</code>.</p><li>
  54. <a href="../reference/functions/iostream/outcome_print.html" ><code>std::string print(const basic_outcome&lt;T, EC, EP, NoValuePolicy&gt; &amp;)</code></a>
  55. <p>Returns a string containing a human readable rendition of the <code>basic_outcome</code>.</p><li>
  56. <a href="../reference/functions/iostream/result_print.html" ><code>std::string print(const basic_result&lt;T, E, NoValuePolicy&gt; &amp;)</code></a>
  57. <p>Returns a string containing a human readable rendition of the <code>basic_result</code>.</p></li></ol><li>
  58. <a href="../reference/functions/policy.html" >Policy</a>
  59. <p>Functions used to customise how the policy classes operate.</p><ol><li>
  60. <a href="../reference/functions/policy/basic_outcome_failure_exception_from_error.html" ><code>auto basic_outcome_failure_exception_from_error(const EC &amp;)</code></a>
  61. <p>ADL discovered free function synthesising an exception type from an error type, used by the <code>.failure()</code> observers.</p><li>
  62. <a href="../reference/functions/policy/error_code.html" ><code>decltype(auto) error_code(T &amp;&amp;)</code></a>
  63. <p>Extracts a <code>boost::system::error_code</code> or <code>std::error_code</code> from the input via ADL discovery of a suitable <code>make_error_code(T)</code> function.</p><li>
  64. <a href="../reference/functions/policy/exception_ptr.html" ><code>decltype(auto) exception_ptr(T &amp;&amp;)</code></a>
  65. <p>Extracts a <code>boost::exception_ptr</code> or <code>std::exception_ptr</code> from the input via ADL discovery of a suitable <code>make_exception_ptr(T)</code> function.</p><li>
  66. <a href="../reference/functions/policy/outcome_throw_as_system_error_with_payload_boost_enum.html" ><code>void outcome_throw_as_system_error_with_payload(BoostErrorCodeEnum &amp;&amp;)</code></a>
  67. <p>Specialisation of <code>outcome_throw_as_system_error_with_payload()</code> for input types where <code>boost::system::is_error_code_enum&lt;BoostErrorCodeEnum&gt;</code> or <code>boost::system::is_error_condition_enum&lt;BoostErrorCodeEnum&gt;</code> is true.</p><li>
  68. <a href="../reference/functions/policy/outcome_throw_as_system_error_with_payload_std_enum.html" ><code>void outcome_throw_as_system_error_with_payload(ErrorCodeEnum &amp;&amp;)</code></a>
  69. <p>Specialisation of <code>outcome_throw_as_system_error_with_payload()</code> for input types where <code>std::is_error_code_enum&lt;ErrorCodeEnum&gt;</code> or <code>std::is_error_condition_enum&lt;ErrorCodeEnum&gt;</code> is true.</p><li>
  70. <a href="../reference/functions/policy/outcome_throw_as_system_error_with_payload_boost_error_code.html" ><code>void outcome_throw_as_system_error_with_payload(const boost::system::error_code &amp;)</code></a>
  71. <p>Specialisation of <code>outcome_throw_as_system_error_with_payload()</code> for <code>boost::system::error_code</code>.</p><li>
  72. <a href="../reference/functions/policy/outcome_throw_as_system_error_with_payload_std_error_code.html" ><code>void outcome_throw_as_system_error_with_payload(const std::error_code &amp;)</code></a>
  73. <p>Specialisation of <code>outcome_throw_as_system_error_with_payload()</code> for <code>std::error_code</code>.</p></li></ol><li>
  74. <a href="../reference/functions/failure.html" ><code>auto failure(T &amp;&amp;, ...)</code></a>
  75. <p>Returns appropriate type sugar for constructing an unsuccessful result or outcome.</p><li>
  76. <a href="../reference/functions/success.html" ><code>auto success(T &amp;&amp;)</code></a>
  77. <p>Returns appropriate type sugar for constructing a successful result or outcome.</p><li>
  78. <a href="../reference/functions/try_operation_has_value.html" ><code>bool try_operation_has_value(X)</code></a>
  79. <p>Default implementation of <code>try_operation_has_value(X)</code> ADL customisation point for <code>BOOST_OUTCOME_TRY</code>.</p><li>
  80. <a href="../reference/functions/try_operation_extract_value.html" ><code>decltype(auto) try_operation_extract_value(X)</code></a>
  81. <p>Default implementation of <code>try_operation_extract_value(X)</code> ADL customisation point for <code>BOOST_OUTCOME_TRY</code>.</p><li>
  82. <a href="../reference/functions/try_operation_return_as.html" ><code>decltype(auto) try_operation_return_as(X)</code></a>
  83. <p>Default implementation of <code>try_operation_return_as(X)</code> ADL customisation point for <code>BOOST_OUTCOME_TRY</code>.</p><li>
  84. <a href="../reference/functions/error_from_exception.html" ><code>std::error_code error_from_exception(std::exception_ptr &amp;&amp;ep = std::current_exception(), std::error_code not_matched = std::make_error_code(std::errc::resource_unavailable_try_again)) noexcept</code></a>
  85. <p>Returns an error code matching a thrown standard library exception.</p><li>
  86. <a href="../reference/functions/strong_swap.html" ><code>void strong_swap(bool &amp;all_good, T &amp;a, T &amp;b)</code></a>
  87. <p>Tries to perform a strong guarantee swap.</p><li>
  88. <a href="../reference/functions/try_throw_std_exception_from_error.html" ><code>void try_throw_std_exception_from_error(std::error_code ec, const std::string &amp;msg = std::string{})</code></a>
  89. <p>Try to throw a standard library exception type matching an error code.</p></li></ol>
  90. </div><p><small>Last revised: December 13, 2018 at 21:10:19 UTC</small></p>
  91. <hr>
  92. <div class="spirit-nav">
  93. <a accesskey="p" href="../reference/aliases/unchecked.html"><img src="../images/prev.png" alt="Prev"></a>
  94. <a accesskey="u" href="../reference.html"><img src="../images/up.png" alt="Up"></a>
  95. <a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../reference/functions/hooks.html"><img src="../images/next.png" alt="Next"></a></div></body>
  96. </html>