interop.html 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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>Interoperation - 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/hooks/hook_outcome.html"><img src="../../images/prev.png" alt="Prev"></a>
  10. <a accesskey="u" href="../../tutorial/advanced.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="../../tutorial/advanced/interop/problem.html"><img src="../../images/next.png" alt="Next"></a></div><div id="content">
  12. <div class="titlepage"><div><div><h1 style="clear: both">Interoperation</h1></div></div></div>
  13. <p>This is the final section of the tutorial, and it is unavoidably quite lengthy
  14. as we are going to tie together all of the material covered in the tutorial
  15. so far into a single, unified, application of Outcome&rsquo;s facilities.</p>
  16. <p>One thing which Outcome solves &ndash; and which alternatives do not &ndash; is how to
  17. <strong>non-intrusively</strong> tie together multiple third party libraries, each using
  18. Outcome &ndash; or some other <code>T|E</code> implementatation like
  19. <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>
  20. &ndash; with custom incommensurate <code>E</code> types, or indeed arbitrary return
  21. types which are &ldquo;split&rdquo; <code>T|E</code> return types. Solving
  22. this well is the <em>coup de grâce</em> of Outcome against alternative approaches
  23. to this problem domain,
  24. including <code>std::expected&lt;T, E&gt;</code>. It is the major reason why you should
  25. consider using Outcome over alternatives, including Expected.</p>
  26. <p>Firstly we shall explore some of the problems faced by the software
  27. developer when <code>T|E</code> return type based code proliferates at scale,
  28. where dozens of libraries may be using completely incompatible <code>T|E</code> return types.</p>
  29. <p>Secondly we shall introduce the <code>ValueOrError</code> concept support in Outcome,
  30. which implements a subset of the proposed <a href="https://wg21.link/P0786">WG21 <code>ValueOrError</code>
  31. concept framework</a>.</p>
  32. <p>Finally, we shall then step through a worked example which mocks up a realistic
  33. situation that the software developer may find themselves in: tying
  34. together disparate third party libraries, whose source code cannot be
  35. modified, into an application-wide, mixed-mode <code>T|E</code> and exception
  36. throwing universal error handling system which is capable of
  37. accurately representing the original failure, but also propagating it
  38. in a way that the application can deal with universally.</p>
  39. </div><p><small>Last revised: February 08, 2019 at 22:18:08 UTC</small></p>
  40. <hr>
  41. <div class="spirit-nav">
  42. <a accesskey="p" href="../../tutorial/advanced/hooks/hook_outcome.html"><img src="../../images/prev.png" alt="Prev"></a>
  43. <a accesskey="u" href="../../tutorial/advanced.html"><img src="../../images/up.png" alt="Up"></a>
  44. <a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../../tutorial/advanced/interop/problem.html"><img src="../../images/next.png" alt="Next"></a></div></body>
  45. </html>