bad_result_access_with.html 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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>bad_result_access_with&lt;EC&gt; - 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/bad_outcome_access.html"><img src="../../images/prev.png" alt="Prev"></a>
  10. <a accesskey="u" href="../../reference/types.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/bad_result_access.html"><img src="../../images/next.png" alt="Next"></a></div><div id="content">
  12. <div class="titlepage"><div><div><h1 style="clear: both"><code>bad_result_access_with&lt;EC&gt;</code></h1></div></div></div>
  13. <p>Exception type publicly inheriting from <a href="../../reference/types/bad_result_access.html" class="api-reference"><code>bad_result_access</code></a>
  14. , and thus also
  15. <a href="https://en.cppreference.com/w/cpp/error/logic_error" class="api-reference" target="_blank"><i class="fa fa-book" aria-hidden="true"></i> <code>std::logic_error</code></a>
  16. , indicating an incorrect observation of value occurred. The error value at the time of the exception throw is moved or copied into this type, and is available using the <code>.error()</code> observer which comes in lvalue ref, const lvalue ref, rvalue ref, and const rvalue ref overloads.</p>
  17. <p>The primary purpose of this exception type is to enable standing in for
  18. <a href="https://wg21.link/P0323" class="api-reference" target="_blank"><i class="fa fa-book" aria-hidden="true"></i> P0323 <code>std::expected&lt;T, E&gt;</code></a>
  19. &rsquo;s <code>bad_expected_access&lt;E&gt;</code> which is thrown on incorrect wide value observation. This is why it is only ever <code>EC</code> which is thrown with <code>bad_result_access_with&lt;EC&gt;</code> on value observation only, and only when there is an error available. See the <a href="../../reference/policies/throw_bad_result_access.html" class="api-reference"><code>throw_bad_result_access&lt;EC&gt;</code></a>
  20. policy for more information.</p>
  21. <p><em>Requires</em>: Nothing.</p>
  22. <p><em>Namespace</em>: <code>BOOST_OUTCOME_V2_NAMESPACE</code></p>
  23. <p><em>Header</em>: <code>&lt;boost/outcome/bad_access.hpp&gt;</code></p>
  24. </div><p><small>Last revised: January 25, 2019 at 01:51:37 UTC</small></p>
  25. <hr>
  26. <div class="spirit-nav">
  27. <a accesskey="p" href="../../reference/types/bad_outcome_access.html"><img src="../../images/prev.png" alt="Prev"></a>
  28. <a accesskey="u" href="../../reference/types.html"><img src="../../images/up.png" alt="Up"></a>
  29. <a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../../reference/types/bad_result_access.html"><img src="../../images/next.png" alt="Next"></a></div></body>
  30. </html>