mirror of
https://github.com/boostorg/outcome.git
synced 2026-01-19 04:22:13 +00:00
75 lines
4.3 KiB
HTML
75 lines
4.3 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Interoperation - Boost.Outcome documentation</title>
|
|
<link rel="stylesheet" href="../css/boost.css" type="text/css">
|
|
<meta name="generator" content="Hugo 0.52 with Boostdoc theme">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
|
|
|
|
<link rel="icon" href="../images/favicon.ico" type="image/ico"/>
|
|
<body><div id="boost-common-heading-doc" style="background: #574D74 url('../images/header-bg.png') repeat-x top left;">
|
|
<div class="heading-inner" style="background: url('../images/header-fg.png') no-repeat top left;">
|
|
<div class="heading-placard"></div>
|
|
|
|
<h1 class="heading-title">
|
|
<a href="../">
|
|
<img src="../images/space.png" alt="Boost C++ Libraries" class="heading-logo" />
|
|
<span class="heading-boost">Boost</span>
|
|
<span class="heading-cpplibraries">C++ Libraries</span>
|
|
</a>
|
|
</h1>
|
|
|
|
<p class="heading-quote">
|
|
<q>...one of the most highly
|
|
regarded and expertly designed C++ library projects in the
|
|
world.</q> <span class="heading-attribution">— <a href=
|
|
"http://www.gotw.ca/" class="external">Herb Sutter</a> and <a href=
|
|
"http://en.wikipedia.org/wiki/Andrei_Alexandrescu" class="external">Andrei
|
|
Alexandrescu</a>, <a href=
|
|
"http://safari.awprofessional.com/?XmlId=0321113586" class="external">C++
|
|
Coding Standards</a></span></p>
|
|
</div>
|
|
</div>
|
|
<div id="boost-common-heading-doc-spacer"></div><div class="spirit-nav">
|
|
<a accesskey="p" href="../tutorial/hooks/hook_outcome.html"><img src="../images/prev.png" alt="Prev"></a>
|
|
<a accesskey="u" href="../tutorial.html"><img src="../images/up.png" alt="Up"></a>
|
|
<a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../tutorial/interop/problem.html"><img src="../images/next.png" alt="Next"></a></div><div id="content">
|
|
|
|
<div class="titlepage"><div><div><h1 style="clear: both">Interoperation</h1></div></div></div>
|
|
<p>This is the final section of the tutorial, and it is unavoidably quite lengthy.</p>
|
|
|
|
<p>One thing which Outcome solves – which alternatives do not – is how to
|
|
<strong>non-intrusively</strong> tie together multiple third party libraries, each using
|
|
Outcome – or some other <code>T|E</code> implementatation like <code>std::expected<T, E></code>
|
|
– with custom incommensurate <code>E</code> types, or indeed arbitrary return
|
|
types which are “split” <code>T|E</code> return types. Solving
|
|
this well is the <em>coup de grâce</em> of Outcome against alternative approaches
|
|
to this problem domain,
|
|
including <code>std::expected<T, E></code>. It is the major reason why you should
|
|
consider using Outcome over alternatives, including Expected.</p>
|
|
|
|
<p>Firstly we shall explore some of the problems faced by the software
|
|
developer when <code>T|E</code> return type based code proliferates at scale,
|
|
where dozens of libraries may be using completely incompatible <code>T|E</code> return types.</p>
|
|
|
|
<p>Secondly we shall introduce the <code>ValueOrError</code> concept support in Outcome
|
|
which implements a subset of the proposed <a href="https://wg21.link/P0786">WG21 <code>ValueOrError</code>
|
|
concept framework</a>.</p>
|
|
|
|
<p>Finally, we shall then step through a worked example which mocks up a realistic
|
|
situation that the software developer may find themselves in: tying
|
|
together disparate third party libraries, whose source code cannot be
|
|
modified, into an application-wide, mixed-mode <code>T|E</code> and exception
|
|
throwing universal error handling system which is capable of
|
|
accurately representing the original failure, but also propagating it
|
|
in a way that the application can deal with universally.</p>
|
|
|
|
|
|
|
|
</div><p><small>Last revised: December 13, 2017 at 09:28:03 UTC</small></p>
|
|
<hr>
|
|
<div class="spirit-nav">
|
|
<a accesskey="p" href="../tutorial/hooks/hook_outcome.html"><img src="../images/prev.png" alt="Prev"></a>
|
|
<a accesskey="u" href="../tutorial.html"><img src="../images/up.png" alt="Up"></a>
|
|
<a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../tutorial/interop/problem.html"><img src="../images/next.png" alt="Next"></a></div></body>
|
|
</html>
|