before.html 5.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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>Before we begin - 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/essential.html"><img src="../../images/prev.png" alt="Prev"></a>
  10. <a accesskey="u" href="../../tutorial/essential.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/essential/result.html"><img src="../../images/next.png" alt="Next"></a></div><div id="content">
  12. <div class="titlepage"><div><div><h1 style="clear: both">Before we begin</h1></div></div></div>
  13. <h2 id="outcome-v2-namespace">Outcome v2 namespace</h2>
  14. <p>It is recommended that you refer to entities from this Outcome v2 via the following namespace alias:</p>
  15. <div class="code-snippet"><div class="highlight"><pre class="chroma"><code class="language-c++" data-lang="c++"><span class="k">namespace</span> <span class="n">outcome</span> <span class="o">=</span> <span class="n">BOOST_OUTCOME_V2_NAMESPACE</span><span class="p">;</span>
  16. </code></pre></div><a href="https://github.com/boostorg/outcome/tree/master/doc/src/snippets/using_result.cpp#L38" class="code-snippet-url" target="_blank">View this code on Github</a></div>
  17. <p>On standalone Outcome only, as patches and modifications are applied to this library,
  18. namespaces get permuted in order to not to cause binary incompatibility. At some point
  19. namespace <code>outcome_v2</code> will be defined, and this will be the preferred namespace.
  20. Until then <code>BOOST_OUTCOME_V2_NAMESPACE</code> denotes the most recently
  21. updated version, getting closer to <code>outcome_v2</code>.</p>
  22. <p>On Boost.Outcome only, as Boost provides no binary compatibility across releases,
  23. <code>BOOST_OUTCOME_V2_NAMESPACE</code> always expands into <code>boost::outcome_v2</code>.</p>
  24. <h2 id="online-compilers">Online compilers</h2>
  25. <p>If you&rsquo;ve never used them before, you will find
  26. <a href="https://godbolt.org/">Godbolt</a> and <a href="https://wandbox.org/">Wandbox</a> invaluable.
  27. These let you play with C++ inside your web browser.</p>
  28. <p>Most of the source code snippets in Outcome have a link in their top right to
  29. the original source code on github. You can copy and paste this source code into
  30. Godbolt (if you wish to study the assembler generated) or Wandbox (if you
  31. wish to run the program).</p>
  32. <h3 id="godbolt">Godbolt</h3>
  33. <p>Godbolt is invaluable for visualising online the assembler generated for a
  34. piece of C++, for all the major compilers and CPU architectures.</p>
  35. <p>Standalone Outcome is built into Godbolt! In the right hand pane toolbar, click the
  36. libraries dropdown (currently third from the right, looks like a book), find
  37. Outcome and choose the version you want.</p>
  38. <p>After this is selected, you can <code>#include</code> any of these editions of Outcome:</p>
  39. <dl>
  40. <dt><code>&lt;outcome-basic.hpp&gt;</code></dt>
  41. <dd>An inclusion of <code>basic_outcome.hpp</code> + <code>try.hpp</code> which includes as few
  42. system headers as possible in order to give an absolute minimum compile time
  43. impact edition of Outcome. See <a href="https://github.com/ned14/stl-header-heft">https://github.com/ned14/stl-header-heft</a>.
  44. </dd>
  45. <dt><code>&lt;outcome-experimental.hpp&gt;</code></dt>
  46. <dd>An inclusion of <code>experimental/status_outcome.hpp</code> + <code>try.hpp</code> which
  47. is the low compile time impact of the basic edition combined with
  48. <code>status_code</code> from <a href="https://ned14.github.io/status-code/">https://ned14.github.io/status-code/</a>. If you are on an
  49. embedded system where binary bloat must be absolutely avoided, and don't
  50. mind the potentially unstable <code>status_code</code>, this is definitely the edition
  51. for you.
  52. </dd>
  53. <dt><code>&lt;outcome.hpp&gt;</code></dt>
  54. <dd>An inclusion of <code>outcome.hpp</code> which brings in all the specialisations
  55. for the <code>std</code> STL types, plus iostreams support. If you don't know which
  56. edition to use, you should use this one, it ought to "just work".</dd>
  57. </dl>
  58. <p>Here is the first tutorial topic&rsquo;s source code loaded into Godbolt: <a href="https://godbolt.org/z/p-NAho">https://godbolt.org/z/p-NAho</a></p>
  59. <h3 id="wandbox">Wandbox</h3>
  60. <p>Wandbox lets you place a third party header into a separate tab. It also
  61. comes with a recent Boost libraries. Either technique can be used to
  62. explore Outcome.</p>
  63. <p>Here is the first tutorial topic&rsquo;s source code loaded into Wandbox: <a href="https://wandbox.org/permlink/sJoeKHXSyCU5Avft">https://wandbox.org/permlink/sJoeKHXSyCU5Avft</a></p>
  64. </div><p><small>Last revised: February 09, 2019 at 14:45:47 UTC</small></p>
  65. <hr>
  66. <div class="spirit-nav">
  67. <a accesskey="p" href="../../tutorial/essential.html"><img src="../../images/prev.png" alt="Prev"></a>
  68. <a accesskey="u" href="../../tutorial/essential.html"><img src="../../images/up.png" alt="Up"></a>
  69. <a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../../tutorial/essential/result.html"><img src="../../images/next.png" alt="Next"></a></div></body>
  70. </html>