failure.html 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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>exception_type failure() const noexcept - 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/types/basic_outcome/exception_rvalue_const.html"><img src="../../../images/prev.png" alt="Prev"></a>
  10. <a accesskey="u" href="../../../reference/types/basic_outcome.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/types/basic_outcome/equality_basic_result.html"><img src="../../../images/next.png" alt="Next"></a></div><div id="content">
  12. <div class="titlepage"><div><div><h1 style="clear: both"><code>exception_type failure() const noexcept</code></h1></div></div></div>
  13. <p>Synthesising observer of the stored exception or error. If an exception is available,
  14. returns a copy of that directly. If an error is available, and not an exception, an
  15. ADL discovered free function <a href="../../../reference/functions/policy/basic_outcome_failure_exception_from_error.html" class="api-reference"><code>auto basic_outcome_failure_exception_from_error(const EC &amp;)</code></a>
  16. is invoked. Default overloads for this function are defined in Outcome for
  17. <a href="https://en.cppreference.com/w/cpp/error/error_code" class="api-reference" target="_blank"><i class="fa fa-book" aria-hidden="true"></i> <code>std::error_code</code></a>
  18. and <code>boost::system::error_code</code>, these return <code>std::make_exception_ptr(std::system_error(ec))</code>
  19. and <code>boost::copy_exception(boost::system::system_error(ec))</code> respectively.</p>
  20. <p><em>Requires</em>: Both the traits <a href="../../../reference/traits/is_error_code_available.html" class="api-reference"><code>is_error_code_available&lt;T&gt;</code></a>
  21. and
  22. <a href="../../../reference/traits/is_exception_ptr_available.html" class="api-reference"><code>is_exception_ptr_available&lt;T&gt;</code></a>
  23. are true.</p>
  24. <p><em>Complexity</em>: Depends on <code>basic_outcome_failure_exception_from_error(const EC &amp;)</code>.</p>
  25. <p><em>Guarantees</em>: Never throws. If an exception is thrown during the copy of the exception,
  26. that exception (from <code>std::current_exception()</code>) is returned instead.</p>
  27. </div><p><small>Last revised: February 05, 2019 at 21:41:47 UTC</small></p>
  28. <hr>
  29. <div class="spirit-nav">
  30. <a accesskey="p" href="../../../reference/types/basic_outcome/exception_rvalue_const.html"><img src="../../../images/prev.png" alt="Prev"></a>
  31. <a accesskey="u" href="../../../reference/types/basic_outcome.html"><img src="../../../images/up.png" alt="Up"></a>
  32. <a accesskey="h" href="../../../index.html"><img src="../../../images/home.png" alt="Home"></a><a accesskey="n" href="../../../reference/types/basic_outcome/equality_basic_result.html"><img src="../../../images/next.png" alt="Next"></a></div></body>
  33. </html>