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>Approximate map between error code designs - 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 8<link rel="icon" href="../images/favicon.ico" type="image/ico"/> 9<body><div class="spirit-nav"> 10<a accesskey="p" href="../experimental/advantages.html"><img src="../images/prev.png" alt="Prev"></a> 11 <a accesskey="u" href="../experimental.html"><img src="../images/up.png" alt="Up"></a> 12 <a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../experimental/differences.html"><img src="../images/next.png" alt="Next"></a></div><div id="content"> 13 <div class="titlepage"><div><div><h1 style="clear: both">Approximate map between error code designs</h1></div></div></div> 14 <p>Much of the design of Boost.System (which went on to become <code><system_error></code>) 15has been retained in proposed <code><system_error2></code>, so an approximate map between 16<code><system_error2></code> and <code><system_error></code> and Boost.System can be given:</p> 17 18<table width="100%" cellpadding="5" border="1"> 19<colgroup> 20 <col width="25%"> 21 <col width="25%"> 22 <col width="50%"> 23</colgroup> 24<tr><th>C++ 17 <tt><system_error></tt><th>Boost.System<th>Proposed <tt><system_error2></tt> 25<tr> 26 <td style="vertical-align: top;"><tt>std::errc</tt> 27 <td style="vertical-align: top;"><tt>boost::system::errc</tt> 28 <td style="vertical-align: top;"><tt>experimental::errc</tt> (almost identical) 29<tr> 30 <td style="vertical-align: top;"><tt>std::error_category</tt> 31 <td style="vertical-align: top;"><tt>boost::system::error_category</tt> 32 <td style="vertical-align: top;"><tt>experimental::status_code_domain</tt> 33<tr> 34 <td style="vertical-align: top;"><tt>std::generic_category</tt> 35 <td style="vertical-align: top;"><tt>boost::system::generic_category</tt> 36 <td style="vertical-align: top;"><tt>experimental::generic_code_domain</tt> 37<tr> 38 <td style="vertical-align: top;"><tt>std::system_category</tt> 39 <td style="vertical-align: top;"><tt>boost::system::system_category</tt> 40 <td style="vertical-align: top;">One of:<ul> 41 <li><tt>experimental::posix_code_domain</tt> (POSIX systems)<p> 42 <li><tt>experimental::win32_code_domain</tt> (Microsoft Windows)<p> 43 <li><tt>experimental::nt_code_domain</tt> (Microsoft Windows) 44 </ul> 45<tr> 46 <td style="vertical-align: top;"><tt>std::error_condition</tt> 47 <td style="vertical-align: top;"><tt>boost::system::error_condition</tt> 48 <td style="vertical-align: top;"><b>No equivalent</b> (deliberately removed as hindsight proved it to be a design mistake leading to much confusing and hard to audit for correctness code) 49<tr> 50 <td style="vertical-align: top;"><tt>std::error_code</tt> 51 <td style="vertical-align: top;"><tt>boost::system::error_code</tt> 52 <td style="vertical-align: top;">One of:<ul> 53 <li><tt>experimental::status_code<DomainType></tt><p> 54 <li><tt>const experimental::status_code<void> &</tt><p> 55 <li><tt>experimental::status_code<erased<intptr_t>></tt> (aliased to <tt>experimental::system_code</tt>)<p> 56 <li><tt>experimental::errored_status_code<DomainType></tt><p> 57 <li><tt>const experimental::errored_status_code<void> &</tt><p> 58 <li><tt>experimental::errored_status_code<erased<intptr_t>></tt> (aliased to <tt>experimental::error</tt>) 59 </ul> 60<tr> 61 <td style="vertical-align: top;"><tt>std::system_error</tt> 62 <td style="vertical-align: top;"><tt>boost::system::system_error</tt> 63 <td style="vertical-align: top;">One of:<ul> 64 <li><tt>const experimental::status_error<void> &</tt><p> 65 <li><tt>experimental::status_error<DomainType></tt> 66 </ul> 67</table> 68 69<p>As is obvious from the above, in <code><system_error2></code> one must be much more specific and accurate 70with respect to intent and specification and desired semantics than with <code><system_error></code>. Much 71ambiguity and incorrectness which flies silently in <code><system_error></code> will 72refuse to compile in <code><system_error2></code>.</p> 73 74 75 </div><p><small>Last revised: January 27, 2019 at 13:13:26 UTC</small></p> 76<hr> 77<div class="spirit-nav"> 78<a accesskey="p" href="../experimental/advantages.html"><img src="../images/prev.png" alt="Prev"></a> 79 <a accesskey="u" href="../experimental.html"><img src="../images/up.png" alt="Up"></a> 80 <a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../experimental/differences.html"><img src="../images/next.png" alt="Next"></a></div></body> 81</html> 82