policies.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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>Policies - 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/traits/type_can_be_used_in_basic_result.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/policies/base.html"><img src="../images/next.png" alt="Next"></a></div><div id="content">
  12. <div class="titlepage"><div><div><h1 style="clear: both">Policies</h1></div></div></div>
  13. <ol class="children children-li"><li>
  14. <a href="../reference/policies/base.html" ><code>base</code></a>
  15. <p>Base class of most policy classes defining the narrow observer policies.</p><ol><li>
  16. <a href="../reference/policies/base/ub.html" ><code>static void _ub(Impl &amp;&amp;)</code></a>
  17. <p>Special function which causes noticeable hard undefined behaviour.</p><li>
  18. <a href="../reference/policies/base/has_value.html" ><code>static bool _has_value(Impl &amp;&amp;) noexcept</code></a>
  19. <p>Returns true if a value is present in the implementation passed in. Constexpr, never throws.</p><li>
  20. <a href="../reference/policies/base/has_error.html" ><code>static bool _has_error(Impl &amp;&amp;) noexcept</code></a>
  21. <p>Returns true if an error is present in the implementation passed in. Constexpr, never throws.</p><li>
  22. <a href="../reference/policies/base/has_exception.html" ><code>static bool _has_exception(Impl &amp;&amp;) noexcept</code></a>
  23. <p>Returns true if an exception is present in the implementation passed in. Constexpr, never throws.</p><li>
  24. <a href="../reference/policies/base/has_error_is_errno.html" ><code>static bool _has_error_is_errno(Impl &amp;&amp;) noexcept</code></a>
  25. <p>Returns true if the error code in the implementation passed in has a domain or category matching that of POSIX <code>errno</code>. Constexpr, never throws.</p><li>
  26. <a href="../reference/policies/base/value.html" ><code>static auto &amp;&amp;_value(Impl &amp;&amp;) noexcept</code></a>
  27. <p>Returns a reference to the value in the implementation passed in. Constexpr, never throws.</p><li>
  28. <a href="../reference/policies/base/error.html" ><code>static auto &amp;&amp;_error(Impl &amp;&amp;) noexcept</code></a>
  29. <p>Returns a reference to the error in the implementation passed in. Constexpr, never throws.</p><li>
  30. <a href="../reference/policies/base/exception.html" ><code>static auto &amp;&amp;_exception(Impl &amp;&amp;) noexcept</code></a>
  31. <p>Returns a reference to the exception in the implementation passed in. Constexpr, never throws.</p><li>
  32. <a href="../reference/policies/base/set_has_value.html" ><code>static void _set_has_value(Impl &amp;&amp;, bool) noexcept</code></a>
  33. <p>Sets whether the implementation has a value. Constexpr, never throws.</p><li>
  34. <a href="../reference/policies/base/set_has_error.html" ><code>static void _set_has_error(Impl &amp;&amp;, bool) noexcept</code></a>
  35. <p>Sets whether the implementation has an error. Constexpr, never throws.</p><li>
  36. <a href="../reference/policies/base/set_has_exception.html" ><code>static void _set_has_exception(Impl &amp;&amp;, bool) noexcept</code></a>
  37. <p>Sets whether the implementation has an exception. Constexpr, never throws.</p><li>
  38. <a href="../reference/policies/base/set_has_error_is_errno.html" ><code>static void _set_has_exception(Impl &amp;&amp;, bool) noexcept</code></a>
  39. <p>Sets whether the implementation&rsquo;s error code has a domain or category matching that of POSIX <code>errno</code>. Constexpr, never throws.</p><li>
  40. <a href="../reference/policies/base/narrow_value_check.html" ><code>static void narrow_value_check(Impl &amp;&amp;) noexcept</code></a>
  41. <p>Observer policy performing hard UB if no value is present. Constexpr, never throws.</p><li>
  42. <a href="../reference/policies/base/narrow_error_check.html" ><code>static void narrow_error_check(Impl &amp;&amp;) noexcept</code></a>
  43. <p>Observer policy performing hard UB if no error is present. Constexpr, never throws.</p><li>
  44. <a href="../reference/policies/base/narrow_exception_check.html" ><code>static void narrow_exception_check(Impl &amp;&amp;) noexcept</code></a>
  45. <p>Observer policy performing hard UB if no exception is present. Constexpr, never throws.</p></li></ol><li>
  46. <a href="../reference/policies/all_narrow.html" ><code>all_narrow</code></a>
  47. <p>Policy class defining that hard undefined behaviour should occur on incorrect narrow and wide value, error or exception observation. Inherits publicly from <code>base</code>.</p><li>
  48. <a href="../reference/policies/error_code_throw_as_system_error_outcome.html" ><code>error_code_throw_as_system_error&lt;T, EC, EP&gt;</code></a>
  49. <p>Policy class defining that <code>EP</code> ought to be rethrown if possible, then the ADL discovered free function <code>outcome_throw_as_system_error_with_payload()</code> should be called on incorrect wide value observation. Inherits publicly from <code>base</code>. Can only be used with <code>basic_outcome</code>.</p><li>
  50. <a href="../reference/policies/error_code_throw_as_system_error_result.html" ><code>error_code_throw_as_system_error&lt;T, EC, void&gt;</code></a>
  51. <p>Policy class defining that the ADL discovered free function <code>outcome_throw_as_system_error_with_payload()</code> should be called on incorrect wide value observation. Inherits publicly from <code>base</code>. Can only be used with <code>basic_result</code>.</p><li>
  52. <a href="../reference/policies/exception_ptr_rethrow_outcome.html" ><code>exception_ptr_rethrow&lt;T, EC, EP&gt;</code></a>
  53. <p>Policy class defining that the ADL discovered free function <code>rethrow_exception()</code> should be called on incorrect wide value observation. Inherits publicly from <code>base</code>. Can only be used with <code>basic_outcome</code>.</p><li>
  54. <a href="../reference/policies/exception_ptr_rethrow_result.html" ><code>exception_ptr_rethrow&lt;T, EC, void&gt;</code></a>
  55. <p>Policy class defining that the ADL discovered free function <code>rethrow_exception()</code> should be called on incorrect wide value observation. Inherits publicly from <code>base</code>. Can only be used with <code>basic_result</code>.</p><li>
  56. <a href="../reference/policies/fail_to_compile_observers.html" ><code>fail_to_compile_observers</code></a>
  57. <p>Policy class defining that a static assertion should occur upon compilation of the wide value, error or exception observation. Inherits publicly from <code>base</code>.</p><li>
  58. <a href="../reference/policies/terminate.html" ><code>terminate</code></a>
  59. <p>Policy class defining that <code>std::terminate()</code> should be called on incorrect wide value, error or exception observation. Inherits publicly from <code>base</code>.</p><li>
  60. <a href="../reference/policies/throw_bad_result_access.html" ><code>throw_bad_result_access&lt;EC&gt;</code></a>
  61. <p>Policy class defining that <code>bad_result_access_with&lt;EC&gt;</code> should be thrown on incorrect wide value observation. Inherits publicly from <code>base</code>.</p></li></ol>
  62. </div><p><small>Last revised: December 13, 2018 at 21:10:19 UTC</small></p>
  63. <hr>
  64. <div class="spirit-nav">
  65. <a accesskey="p" href="../reference/traits/type_can_be_used_in_basic_result.html"><img src="../images/prev.png" alt="Prev"></a>
  66. <a accesskey="u" href="../reference.html"><img src="../images/up.png" alt="Up"></a>
  67. <a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../reference/policies/base.html"><img src="../images/next.png" alt="Next"></a></div></body>
  68. </html>