conclusion.html 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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>Conclusion - 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="../../../tutorial/advanced/interop/app-go.html"><img src="../../../images/prev.png" alt="Prev"></a>
  10. <a accesskey="u" href="../../../tutorial/advanced/interop.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="../../../recipes.html"><img src="../../../images/next.png" alt="Next"></a></div><div id="content">
  12. <div class="titlepage"><div><div><h1 style="clear: both">Conclusion</h1></div></div></div>
  13. <p>This worked example was in fact excessively complex: a quicker route
  14. to achieving the same thing would be to add explicit converting constructors
  15. to <code>app::error_code</code> for each of the third party library <code>E</code> types.
  16. One then could have saved oneself with having to bother injecting
  17. custom converters into the <code>BOOST_OUTCOME_V2_NAMESPACE::convert</code> namespace.
  18. If you control your application&rsquo;s <code>E</code> type, then that is probably a
  19. better, and certainly simpler, approach.</p>
  20. <p>However there are occasions when you don&rsquo;t have control over the
  21. implementation of the destination <code>E</code> type e.g. in callbacks. Outcome&rsquo;s <code>ValueOrError</code>
  22. infrastructure lets you inject custom interop code for any pair
  23. of incommensurate third party <code>E</code> types, without needing to modify either&rsquo;s
  24. source code.</p>
  25. <p>This is without doubt a &ldquo;power users&rdquo; feature, but
  26. one which will prove useful as <code>T|E</code> based C++ code proliferates.</p>
  27. </div><p><small>Last revised: February 11, 2019 at 13:38:04 UTC</small></p>
  28. <hr>
  29. <div class="spirit-nav">
  30. <a accesskey="p" href="../../../tutorial/advanced/interop/app-go.html"><img src="../../../images/prev.png" alt="Prev"></a>
  31. <a accesskey="u" href="../../../tutorial/advanced/interop.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="../../../recipes.html"><img src="../../../images/next.png" alt="Next"></a></div></body>
  33. </html>