success_type.html 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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>success_type&lt;T&gt; - 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/types/in_place_type_t.html"><img src="../../images/prev.png" alt="Prev"></a>
  10. <a accesskey="u" href="../../reference/types.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/aliases.html"><img src="../../images/next.png" alt="Next"></a></div><div id="content">
  12. <div class="titlepage"><div><div><h1 style="clear: both"><code>success_type&lt;T&gt;</code></h1></div></div></div>
  13. <p>Type sugar for constructing a successful result or outcome. Generally not constructed directly, but via the free function <a href="../../reference/functions/success.html" class="api-reference"><code>success(T &amp;&amp;)</code></a>
  14. . Detectable using <a href="../../reference/traits/is_success_type.html" class="api-reference"><code>is_success_type&lt;T&gt;</code></a>
  15. .</p>
  16. <p>This is a regular wrapper type, with defaulted default, copy and move constructor, defaulted assignment, and defaulted destructor.</p>
  17. <p>A member type alias <code>value_type</code> indicates <code>T</code>.</p>
  18. <p>There is an explicit initialising constructor taking any type <code>U</code> which is not a <code>success_type&lt;T&gt;</code>, and which will forward construct the contained <code>T</code> from that <code>U</code>.</p>
  19. <p>There is a <code>.value()</code> reference observer with the usual constexpr lvalue, const lvalue, rvalue and const rvalue overloads.</p>
  20. <p>There is a specialisation <code>success_type&lt;void&gt;</code> which stores nothing and provides no <code>.value()</code> observers.</p>
  21. <p><em>Requires</em>: Nothing.</p>
  22. <p><em>Namespace</em>: <code>BOOST_OUTCOME_V2_NAMESPACE</code></p>
  23. <p><em>Header</em>: <code>&lt;boost/outcome/success_failure.hpp&gt;</code></p>
  24. </div><p><small>Last revised: January 21, 2019 at 18:00:41 UTC</small></p>
  25. <hr>
  26. <div class="spirit-nav">
  27. <a accesskey="p" href="../../reference/types/in_place_type_t.html"><img src="../../images/prev.png" alt="Prev"></a>
  28. <a accesskey="u" href="../../reference/types.html"><img src="../../images/up.png" alt="Up"></a>
  29. <a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../../reference/aliases.html"><img src="../../images/next.png" alt="Next"></a></div></body>
  30. </html>