fail_to_compile_observers.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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>fail_to_compile_observers - 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/policies/exception_ptr_rethrow_result.html"><img src="../../images/prev.png" alt="Prev"></a>
  10. <a accesskey="u" href="../../reference/policies.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/terminate.html"><img src="../../images/next.png" alt="Next"></a></div><div id="content">
  12. <div class="titlepage"><div><div><h1 style="clear: both"><code>fail_to_compile_observers</code></h1></div></div></div>
  13. <p>Upon attempting to compile the wide observer policy functions, the following static assertion occurs which fails the build:</p>
  14. <blockquote>
  15. <p><em>Attempt to wide observe value, error or exception for a result/outcome given an EC or E type which is not void, and for whom trait::has_error_code_v<EC>, trait::has_exception_ptr_v<EC>, and trait::has_exception_ptr_v<E> are all false. Please specify a NoValuePolicy to tell result/outcome what to do, or else use a more specific convenience type alias such as unchecked<T, E> to indicate you want the wide observers to be narrow, or checked<T, E> to indicate you always want an exception throw etc.</em></p>
  16. </blockquote>
  17. <p>This failure to compile was introduced after the Boost peer review of v2.0 of Outcome due to feedback that users were too often surprised by the default selection of the <a href="../../reference/policies/all_narrow.html" class="api-reference"><code>all_narrow</code></a>
  18. policy if the types were unrecognised. It was felt this introduced too much danger in the default configuration, so to ensure that existing code based on Outcome broke very loudly after an upgrade, the above very verbose static assertion was implemented.</p>
  19. <p><em>Requires</em>: Nothing.</p>
  20. <p><em>Namespace</em>: <code>BOOST_OUTCOME_V2_NAMESPACE::policy</code></p>
  21. <p><em>Header</em>: <code>&lt;boost/outcome/policy/fail_to_compile_observers.hpp&gt;</code></p>
  22. </div><p><small>Last revised: January 23, 2019 at 01:27:31 UTC</small></p>
  23. <hr>
  24. <div class="spirit-nav">
  25. <a accesskey="p" href="../../reference/policies/exception_ptr_rethrow_result.html"><img src="../../images/prev.png" alt="Prev"></a>
  26. <a accesskey="u" href="../../reference/policies.html"><img src="../../images/up.png" alt="Up"></a>
  27. <a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../../reference/policies/terminate.html"><img src="../../images/next.png" alt="Next"></a></div></body>
  28. </html>