map.html 4.8 KB

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