]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/system/doc/index.html
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / system / doc / index.html
CommitLineData
7c673cae
FG
1<html>
2
3<head>
4<meta http-equiv="Content-Language" content="en-us">
5<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
6<meta name="ProgId" content="FrontPage.Editor.Document">
7<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
8<title>Boost System Library</title>
9<link rel="stylesheet" type="text/css" href="../../../doc/src/minimal.css">
10</head>
11
12<body>
13
14<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
15 <tr>
16 <td width="277">
17<a href="../../../index.html">
18<img src="../../../boost.png" alt="boost.png (6897 bytes)" align="middle" width="277" height="86" border="0"></a></td>
19 <td width="337" align="middle">
20 <font size="7">System Library</font>
21 </td>
22 </tr>
23</table>
24
25<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="100%">
26 <tr>
27 <td><a href="../../../index.htm">Boost Home</a>&nbsp;&nbsp;&nbsp; <a href="index.html">
28 Library Home</a>&nbsp;&nbsp; Tutorial&nbsp;&nbsp; <a href="reference.html">
29 Reference</a></td>
30 </tr>
31</table>
32
33<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" align="right">
34 <tr>
35 <td width="100%" bgcolor="#D7EEFF" align="center">
36 <i><b>Contents</b></i></td>
37 </tr>
38 <tr>
39 <td width="100%" bgcolor="#E8F5FF">
40 <a href="#Introduction">Introduction</a><br>
41 <a href="#Release_History">Release History</a><br>
42 <a href="#Design_Rationale">Design Rationale</a><br>
43 <a href="#History">History</a><br>
44 <a href="#Acknowledgements">Acknowledgements</a>
45 </td>
46 </tr>
47 <tr>
48 <td width="100%" bgcolor="#D7EEFF" align="center">
49 <b><i>Headers</i></b></td>
50 </tr>
51 <tr>
52 <td width="100%" bgcolor="#E8F5FF">
53 <a href="reference.html#Header-error_code">&lt;boost/system/error_code.hpp&gt;</a><br>
54 <a href="reference.html#Header-system_error">
55 &lt;boost/system/system_error.hpp&gt;</a><br>
56 <a href="../../../boost/system/cygwin_error.hpp">
57 &lt;boost/system/cygwin_error.hpp&gt;</a><br>
58 <a href="../../../boost/system/linux_error.hpp">
59 &lt;boost/system/linux_error.hpp&gt;</a><br>
60 <a href="../../../boost/system/windows_error.hpp">
61 &lt;boost/system/windows_error.hpp&gt;</a></td>
62 </tr>
63</table>
64
65<h2><a name="Introduction">Introduction</a></h2>
66
67<p>Error conditions originating from the operating system or other low-level
68application program interfaces (API's) are typically reported via an integer
69representing an error code. When these low-level API calls are wrapped in
70portable code, such as in a portable library, some users want to deal with the
71error codes in portable ways. Other users need to get at the system specific
72error codes, so they can deal with system specific needs. The Boost System
73library provides simple, light-weight <a href="reference.html#Class-error_code">
74error_code</a> objects that encapsulate system-specific error code values, yet
75also provide access to more abstract and portable error conditions via
76<a href="reference.html#Class-error_condition">error_condition</a> objects.
77Because error_code objects can represent errors from sources other than the
78operating system, including user-defined sources, each error_code and
79error_condition has an associated <a href="reference.html#Class-error_category">
80error_category</a>.</p>
81
82<p>An exception class,&nbsp; <a href="reference.html#Class-system_error">
83system_error</a>, is provided. Derived from std::runtime_error, it captures the
84underlying error_code for the problem causing the exception so that this
85important information is not lost.</p>
86<p>While exceptions are the preferred C++ default error code reporting
87mechanism, users of libraries dependent on low-level API's&nbsp;often need overloads
88reporting error conditions via error code arguments and/or return values rather
89than via throwing exceptions. Otherwise, when errors are not exceptional
90occurrences and must be dealt with as they arise, programs become littered with
91try/catch blocks, unreadable, and very inefficient. The Boost System library
92supports both error reporting by exception and by error code.</p>
93<p>In addition to portable errors codes and conditions supported by the <code>
94error_code.hpp</code> header, system-specific headers support the Cygwin, Linux,
95and Windows platforms. These headers are effectively no-ops if included for
96platforms other than their intended target.</p>
97<table border="1" cellpadding="10" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111">
98 <tr>
99 <td>The Boost System Library is part of the C++11 Standard Library.
100 A number of changes, particularly to names, were made by the C++ committee
101 during standardization. The Boost implementation is tracking those changes.
102 See <a href="reference.html#Deprecated-names">Deprecated names</a> for
103 synonyms provided to prevent breakage of existing user code. See
104 <a href="reference.html#Breaking-changes">Breaking changes</a> for changes
105 that unavoidably break existing user code. All breaking changes are noisy
106 and will cause compile-time errors.</td>
107 </tr>
108</table>
109<h2><a name="Release_History">Release History</a></h2>
110<p><code>system-2014-06-02</code>: First modular Boost release. Minor
111maintenance changes.</p>
112<h2><a name="Design_Rationale">Design Rationale</a></h2>
113<p>Class <code>error_code</code>&nbsp; and <code>error_condition</code> are designed as a value types so
114they can be copied
115without slicing and do not requiring heap allocation, but still have polymorphic
116behavior based on the error category. This is achieved by abstract base class
117<code>error_category</code> supplying the polymorphic behavior, and <code>
118error_code</code> and <code>error_condition</code> containing a pointer to an object of a type derived from <code>
119error_category</code>.</p>
120<p>Many of the detailed design decisions were driven by the requirements that
121users to be able to add additional error categories, and that it be no more
122difficult to write portable code than system-specific code.</p>
123<p>The <code>operator&lt;&lt;</code> overload for <code>error_code</code> eliminates a
124misleading conversion to bool in code like <code>cout &lt;&lt; ec</code>, where <code>
125ec</code> is of type <code>error_code</code>. It is also useful in its own
126right.</p>
127<h2><a name="History">History</a></h2>
128<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1975.html">
129N1975</a>, Filesystem Library Proposal for TR2, accepted for Library Technical
130Report 2 (TR2) at the Berlin meeting, included additional components to
131supplement the Standard Library's Diagnostics clause. Since then, these error
132reporting components have received wider public scrutiny and enhancements have
133been made to the design. The enhanced version has been used by N2054, Networking
134Library Proposal for TR2, demonstrating that these error reporting components
135are useful beyond the original Filesystem Library.</p>
136<p>The original proposal viewed error categories as a binary choice between
137<code>errno</code> (i.e. POSIX-style) and the native operating system's error
138codes. The proposed components now allow as many additional error categories as
139are needed by either implementations or by users. The need to support additional
140error categories, for example, occurs in some networking library implementations
141because they are built on top of the POSIX <code>getaddrinfo</code> API that
142uses error codes not based on <code>errno</code>.</p>
143<h2><a name="Acknowledgements">Acknowledgements</a></h2>
144<p>Christopher Kohlhoff and Peter Dimov made important contributions to the
145design. Comments and suggestions were also received from Pavel Vozenilek,
146Gennaro Prota, Dave Abrahams, Jeff Garland, Iain Hanson, Oliver Kowalke, and
147Oleg Abrosimov. Christopher Kohlhoff suggested several improvements to the N2066
148paper. Johan Nilsson's comments led to several of the refinements in N2066 .</p>
149<hr>
150
151<p>Revised
152<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%B %d, %Y" startspan -->June 02, 2014<!--webbot bot="Timestamp" endspan i-checksum="13984" --> </font>
153</p>
154
155