Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / system / doc / html / system.html
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="UTF-8">
5 <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
6 <meta name="viewport" content="width=device-width, initial-scale=1.0">
7 <meta name="generator" content="Asciidoctor 1.5.8">
8 <meta name="author" content="Beman Dawes, Christopher Kohlhoff, Peter Dimov">
9 <title>Boost.System: Extensible Error Reporting</title>
10 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
11 <style>
12 /* Asciidoctor default stylesheet | MIT License | http://asciidoctor.org */
13 /* Uncomment @import statement below to use as custom stylesheet */
14 /*@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700";*/
15 article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}
16 audio,canvas,video{display:inline-block}
17 audio:not([controls]){display:none;height:0}
18 script{display:none!important}
19 html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
20 a{background:transparent}
21 a:focus{outline:thin dotted}
22 a:active,a:hover{outline:0}
23 h1{font-size:2em;margin:.67em 0}
24 abbr[title]{border-bottom:1px dotted}
25 b,strong{font-weight:bold}
26 dfn{font-style:italic}
27 hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}
28 mark{background:#ff0;color:#000}
29 code,kbd,pre,samp{font-family:monospace;font-size:1em}
30 pre{white-space:pre-wrap}
31 q{quotes:"\201C" "\201D" "\2018" "\2019"}
32 small{font-size:80%}
33 sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
34 sup{top:-.5em}
35 sub{bottom:-.25em}
36 img{border:0}
37 svg:not(:root){overflow:hidden}
38 figure{margin:0}
39 fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}
40 legend{border:0;padding:0}
41 button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}
42 button,input{line-height:normal}
43 button,select{text-transform:none}
44 button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}
45 button[disabled],html input[disabled]{cursor:default}
46 input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}
47 button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}
48 textarea{overflow:auto;vertical-align:top}
49 table{border-collapse:collapse;border-spacing:0}
50 *,*::before,*::after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}
51 html,body{font-size:100%}
52 body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;font-weight:400;font-style:normal;line-height:1;position:relative;cursor:auto;tab-size:4;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}
53 a:hover{cursor:pointer}
54 img,object,embed{max-width:100%;height:auto}
55 object,embed{height:100%}
56 img{-ms-interpolation-mode:bicubic}
57 .left{float:left!important}
58 .right{float:right!important}
59 .text-left{text-align:left!important}
60 .text-right{text-align:right!important}
61 .text-center{text-align:center!important}
62 .text-justify{text-align:justify!important}
63 .hide{display:none}
64 img,object,svg{display:inline-block;vertical-align:middle}
65 textarea{height:auto;min-height:50px}
66 select{width:100%}
67 .center{margin-left:auto;margin-right:auto}
68 .stretch{width:100%}
69 .subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em}
70 div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0;direction:ltr}
71 a{color:#2156a5;text-decoration:underline;line-height:inherit}
72 a:hover,a:focus{color:#1d4b8f}
73 a img{border:none}
74 p{font-family:inherit;font-weight:400;font-size:1em;line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility}
75 p aside{font-size:.875em;line-height:1.35;font-style:italic}
76 h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em}
77 h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0}
78 h1{font-size:2.125em}
79 h2{font-size:1.6875em}
80 h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em}
81 h4,h5{font-size:1.125em}
82 h6{font-size:1em}
83 hr{border:solid #dddddf;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em;height:0}
84 em,i{font-style:italic;line-height:inherit}
85 strong,b{font-weight:bold;line-height:inherit}
86 small{font-size:60%;line-height:inherit}
87 code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;color:rgba(0,0,0,.9)}
88 ul,ol,dl{font-size:1em;line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit}
89 ul,ol{margin-left:1.5em}
90 ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0;font-size:1em}
91 ul.square li ul,ul.circle li ul,ul.disc li ul{list-style:inherit}
92 ul.square{list-style-type:square}
93 ul.circle{list-style-type:circle}
94 ul.disc{list-style-type:disc}
95 ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0}
96 dl dt{margin-bottom:.3125em;font-weight:bold}
97 dl dd{margin-bottom:1.25em}
98 abbr,acronym{text-transform:uppercase;font-size:90%;color:rgba(0,0,0,.8);border-bottom:1px dotted #ddd;cursor:help}
99 abbr{text-transform:none}
100 blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd}
101 blockquote cite{display:block;font-size:.9375em;color:rgba(0,0,0,.6)}
102 blockquote cite::before{content:"\2014 \0020"}
103 blockquote cite a,blockquote cite a:visited{color:rgba(0,0,0,.6)}
104 blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)}
105 @media screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2}
106 h1{font-size:2.75em}
107 h2{font-size:2.3125em}
108 h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em}
109 h4{font-size:1.4375em}}
110 table{background:#fff;margin-bottom:1.25em;border:solid 1px #dedede}
111 table thead,table tfoot{background:#f7f8f7}
112 table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left}
113 table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)}
114 table tr.even,table tr.alt,table tr:nth-of-type(even){background:#f8f8f7}
115 table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{display:table-cell;line-height:1.6}
116 h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em}
117 h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400}
118 .clearfix::before,.clearfix::after,.float-group::before,.float-group::after{content:" ";display:table}
119 .clearfix::after,.float-group::after{clear:both}
120 *:not(pre)>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background-color:#f7f7f8;-webkit-border-radius:4px;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed;word-wrap:break-word}
121 *:not(pre)>code.nobreak{word-wrap:normal}
122 *:not(pre)>code.nowrap{white-space:nowrap}
123 pre,pre>code{line-height:1.45;color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;text-rendering:optimizeSpeed}
124 em em{font-style:normal}
125 strong strong{font-weight:400}
126 .keyseq{color:rgba(51,51,51,.8)}
127 kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background-color:#f7f7f7;border:1px solid #ccc;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em white inset;box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em #fff inset;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap}
128 .keyseq kbd:first-child{margin-left:0}
129 .keyseq kbd:last-child{margin-right:0}
130 .menuseq,.menuref{color:#000}
131 .menuseq b:not(.caret),.menuref{font-weight:inherit}
132 .menuseq{word-spacing:-.02em}
133 .menuseq b.caret{font-size:1.25em;line-height:.8}
134 .menuseq i.caret{font-weight:bold;text-align:center;width:.45em}
135 b.button::before,b.button::after{position:relative;top:-1px;font-weight:400}
136 b.button::before{content:"[";padding:0 3px 0 2px}
137 b.button::after{content:"]";padding:0 2px 0 3px}
138 p a>code:hover{color:rgba(0,0,0,.9)}
139 #header,#content,#footnotes,#footer{width:100%;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em}
140 #header::before,#header::after,#content::before,#content::after,#footnotes::before,#footnotes::after,#footer::before,#footer::after{content:" ";display:table}
141 #header::after,#content::after,#footnotes::after,#footer::after{clear:both}
142 #content{margin-top:1.25em}
143 #content::before{content:none}
144 #header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0}
145 #header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #dddddf}
146 #header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px}
147 #header .details{border-bottom:1px solid #dddddf;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;flex-flow:row wrap}
148 #header .details span:first-child{margin-left:-.125em}
149 #header .details span.email a{color:rgba(0,0,0,.85)}
150 #header .details br{display:none}
151 #header .details br+span::before{content:"\00a0\2013\00a0"}
152 #header .details br+span.author::before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)}
153 #header .details br+span#revremark::before{content:"\00a0|\00a0"}
154 #header #revnumber{text-transform:capitalize}
155 #header #revnumber::after{content:"\00a0"}
156 #content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #dddddf;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem}
157 #toc{border-bottom:1px solid #e7e7e9;padding-bottom:.5em}
158 #toc>ul{margin-left:.125em}
159 #toc ul.sectlevel0>li>a{font-style:italic}
160 #toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0}
161 #toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none}
162 #toc li{line-height:1.3334;margin-top:.3334em}
163 #toc a{text-decoration:none}
164 #toc a:active{text-decoration:underline}
165 #toctitle{color:#7a2518;font-size:1.2em}
166 @media screen and (min-width:768px){#toctitle{font-size:1.375em}
167 body.toc2{padding-left:15em;padding-right:0}
168 #toc.toc2{margin-top:0!important;background-color:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #e7e7e9;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto}
169 #toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}
170 #toc.toc2>ul{font-size:.9em;margin-bottom:0}
171 #toc.toc2 ul ul{margin-left:0;padding-left:1em}
172 #toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em}
173 body.toc2.toc-right{padding-left:0;padding-right:15em}
174 body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #e7e7e9;left:auto;right:0}}
175 @media screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
176 #toc.toc2{width:20em}
177 #toc.toc2 #toctitle{font-size:1.375em}
178 #toc.toc2>ul{font-size:.95em}
179 #toc.toc2 ul ul{padding-left:1.25em}
180 body.toc2.toc-right{padding-left:0;padding-right:20em}}
181 #content #toc{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}
182 #content #toc>:first-child{margin-top:0}
183 #content #toc>:last-child{margin-bottom:0}
184 #footer{max-width:100%;background-color:rgba(0,0,0,.8);padding:1.25em}
185 #footer-text{color:rgba(255,255,255,.8);line-height:1.44}
186 #content{margin-bottom:.625em}
187 .sect1{padding-bottom:.625em}
188 @media screen and (min-width:768px){#content{margin-bottom:1.25em}
189 .sect1{padding-bottom:1.25em}}
190 .sect1:last-child{padding-bottom:0}
191 .sect1+.sect1{border-top:1px solid #e7e7e9}
192 #content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}
193 #content h1>a.anchor::before,h2>a.anchor::before,h3>a.anchor::before,#toctitle>a.anchor::before,.sidebarblock>.content>.title>a.anchor::before,h4>a.anchor::before,h5>a.anchor::before,h6>a.anchor::before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
194 #content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible}
195 #content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none}
196 #content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221}
197 .audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em}
198 .admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic}
199 table.tableblock.fit-content>caption.title{white-space:nowrap;width:0}
200 .paragraph.lead>p,#preamble>.sectionbody>[class="paragraph"]:first-of-type p{font-size:1.21875em;line-height:1.6;color:rgba(0,0,0,.85)}
201 table.tableblock #preamble>.sectionbody>[class="paragraph"]:first-of-type p{font-size:inherit}
202 .admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%}
203 .admonitionblock>table td.icon{text-align:center;width:80px}
204 .admonitionblock>table td.icon img{max-width:none}
205 .admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase}
206 .admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6)}
207 .admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
208 .exampleblock>.content{border-style:solid;border-width:1px;border-color:#e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;-webkit-border-radius:4px;border-radius:4px}
209 .exampleblock>.content>:first-child{margin-top:0}
210 .exampleblock>.content>:last-child{margin-bottom:0}
211 .sidebarblock{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}
212 .sidebarblock>:first-child{margin-top:0}
213 .sidebarblock>:last-child{margin-bottom:0}
214 .sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
215 .exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
216 .literalblock pre,.listingblock pre:not(.highlight),.listingblock pre[class="highlight"],.listingblock pre[class^="highlight "],.listingblock pre.CodeRay,.listingblock pre.prettyprint{background:#f7f7f8}
217 .sidebarblock .literalblock pre,.sidebarblock .listingblock pre:not(.highlight),.sidebarblock .listingblock pre[class="highlight"],.sidebarblock .listingblock pre[class^="highlight "],.sidebarblock .listingblock pre.CodeRay,.sidebarblock .listingblock pre.prettyprint{background:#f2f1f1}
218 .literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{-webkit-border-radius:4px;border-radius:4px;word-wrap:break-word;overflow-x:auto;padding:1em;font-size:.8125em}
219 @media screen and (min-width:768px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:.90625em}}
220 @media screen and (min-width:1280px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:1em}}
221 .literalblock pre.nowrap,.literalblock pre.nowrap pre,.listingblock pre.nowrap,.listingblock pre.nowrap pre{white-space:pre;word-wrap:normal}
222 .literalblock.output pre{color:#f7f7f8;background-color:rgba(0,0,0,.9)}
223 .listingblock pre.highlightjs{padding:0}
224 .listingblock pre.highlightjs>code{padding:1em;-webkit-border-radius:4px;border-radius:4px}
225 .listingblock pre.prettyprint{border-width:0}
226 .listingblock>.content{position:relative}
227 .listingblock code[data-lang]::before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:#999}
228 .listingblock:hover code[data-lang]::before{display:block}
229 .listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:.5em;color:#999}
230 .listingblock.terminal pre .command:not([data-prompt])::before{content:"$"}
231 table.pyhltable{border-collapse:separate;border:0;margin-bottom:0;background:none}
232 table.pyhltable td{vertical-align:top;padding-top:0;padding-bottom:0;line-height:1.45}
233 table.pyhltable td.code{padding-left:.75em;padding-right:0}
234 pre.pygments .lineno,table.pyhltable td:not(.code){color:#999;padding-left:0;padding-right:.5em;border-right:1px solid #dddddf}
235 pre.pygments .lineno{display:inline-block;margin-right:.25em}
236 table.pyhltable .linenodiv{background:none!important;padding-right:0!important}
237 .quoteblock{margin:0 1em 1.25em 1.5em;display:table}
238 .quoteblock>.title{margin-left:-1.5em;margin-bottom:.75em}
239 .quoteblock blockquote,.quoteblock p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify}
240 .quoteblock blockquote{margin:0;padding:0;border:0}
241 .quoteblock blockquote::before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)}
242 .quoteblock blockquote>.paragraph:last-child p{margin-bottom:0}
243 .quoteblock .attribution{margin-top:.75em;margin-right:.5ex;text-align:right}
244 .verseblock{margin:0 1em 1.25em}
245 .verseblock pre{font-family:"Open Sans","DejaVu Sans",sans;font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:300;text-rendering:optimizeLegibility}
246 .verseblock pre strong{font-weight:400}
247 .verseblock .attribution{margin-top:1.25rem;margin-left:.5ex}
248 .quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic}
249 .quoteblock .attribution br,.verseblock .attribution br{display:none}
250 .quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)}
251 .quoteblock.abstract blockquote::before,.quoteblock.excerpt blockquote::before,.quoteblock .quoteblock blockquote::before{display:none}
252 .quoteblock.abstract blockquote,.quoteblock.abstract p,.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{line-height:1.6;word-spacing:0}
253 .quoteblock.abstract{margin:0 1em 1.25em;display:block}
254 .quoteblock.abstract>.title{margin:0 0 .375em;font-size:1.15em;text-align:center}
255 .quoteblock.excerpt,.quoteblock .quoteblock{margin:0 0 1.25em;padding:0 0 .25em 1em;border-left:.25em solid #dddddf}
256 .quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{color:inherit;font-size:1.0625rem}
257 .quoteblock.excerpt .attribution,.quoteblock .quoteblock .attribution{color:inherit;text-align:left;margin-right:0}
258 table.tableblock{max-width:100%;border-collapse:separate}
259 p.tableblock:last-child{margin-bottom:0}
260 td.tableblock>.content{margin-bottom:-1.25em}
261 table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
262 table.grid-all>thead>tr>.tableblock,table.grid-all>tbody>tr>.tableblock{border-width:0 1px 1px 0}
263 table.grid-all>tfoot>tr>.tableblock{border-width:1px 1px 0 0}
264 table.grid-cols>*>tr>.tableblock{border-width:0 1px 0 0}
265 table.grid-rows>thead>tr>.tableblock,table.grid-rows>tbody>tr>.tableblock{border-width:0 0 1px}
266 table.grid-rows>tfoot>tr>.tableblock{border-width:1px 0 0}
267 table.grid-all>*>tr>.tableblock:last-child,table.grid-cols>*>tr>.tableblock:last-child{border-right-width:0}
268 table.grid-all>tbody>tr:last-child>.tableblock,table.grid-all>thead:last-child>tr>.tableblock,table.grid-rows>tbody>tr:last-child>.tableblock,table.grid-rows>thead:last-child>tr>.tableblock{border-bottom-width:0}
269 table.frame-all{border-width:1px}
270 table.frame-sides{border-width:0 1px}
271 table.frame-topbot,table.frame-ends{border-width:1px 0}
272 table.stripes-all tr,table.stripes-odd tr:nth-of-type(odd){background:#f8f8f7}
273 table.stripes-none tr,table.stripes-odd tr:nth-of-type(even){background:none}
274 th.halign-left,td.halign-left{text-align:left}
275 th.halign-right,td.halign-right{text-align:right}
276 th.halign-center,td.halign-center{text-align:center}
277 th.valign-top,td.valign-top{vertical-align:top}
278 th.valign-bottom,td.valign-bottom{vertical-align:bottom}
279 th.valign-middle,td.valign-middle{vertical-align:middle}
280 table thead th,table tfoot th{font-weight:bold}
281 tbody tr th{display:table-cell;line-height:1.6;background:#f7f8f7}
282 tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold}
283 p.tableblock>code:only-child{background:none;padding:0}
284 p.tableblock{font-size:1em}
285 td>div.verse{white-space:pre}
286 ol{margin-left:1.75em}
287 ul li ol{margin-left:1.5em}
288 dl dd{margin-left:1.125em}
289 dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0}
290 ol>li p,ul>li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em}
291 ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none}
292 ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:.625em}
293 ul.unstyled,ol.unstyled{margin-left:0}
294 ul.checklist{margin-left:.625em}
295 ul.checklist li>p:first-child>.fa-square-o:first-child,ul.checklist li>p:first-child>.fa-check-square-o:first-child{width:1.25em;font-size:.8em;position:relative;bottom:.125em}
296 ul.checklist li>p:first-child>input[type="checkbox"]:first-child{margin-right:.25em}
297 ul.inline{display:-ms-flexbox;display:-webkit-box;display:flex;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;flex-flow:row wrap;list-style:none;margin:0 0 .625em -1.25em}
298 ul.inline>li{margin-left:1.25em}
299 .unstyled dl dt{font-weight:400;font-style:normal}
300 ol.arabic{list-style-type:decimal}
301 ol.decimal{list-style-type:decimal-leading-zero}
302 ol.loweralpha{list-style-type:lower-alpha}
303 ol.upperalpha{list-style-type:upper-alpha}
304 ol.lowerroman{list-style-type:lower-roman}
305 ol.upperroman{list-style-type:upper-roman}
306 ol.lowergreek{list-style-type:lower-greek}
307 .hdlist>table,.colist>table{border:0;background:none}
308 .hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none}
309 td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em}
310 td.hdlist1{font-weight:bold;padding-bottom:1.25em}
311 .literalblock+.colist,.listingblock+.colist{margin-top:-.5em}
312 .colist td:not([class]):first-child{padding:.4em .75em 0;line-height:1;vertical-align:top}
313 .colist td:not([class]):first-child img{max-width:none}
314 .colist td:not([class]):last-child{padding:.25em 0}
315 .thumb,.th{line-height:0;display:inline-block;border:solid 4px #fff;-webkit-box-shadow:0 0 0 1px #ddd;box-shadow:0 0 0 1px #ddd}
316 .imageblock.left{margin:.25em .625em 1.25em 0}
317 .imageblock.right{margin:.25em 0 1.25em .625em}
318 .imageblock>.title{margin-bottom:0}
319 .imageblock.thumb,.imageblock.th{border-width:6px}
320 .imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em}
321 .image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0}
322 .image.left{margin-right:.625em}
323 .image.right{margin-left:.625em}
324 a.image{text-decoration:none;display:inline-block}
325 a.image object{pointer-events:none}
326 sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super}
327 sup.footnote a,sup.footnoteref a{text-decoration:none}
328 sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
329 #footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
330 #footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em;border-width:1px 0 0}
331 #footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;margin-bottom:.2em}
332 #footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none;margin-left:-1.05em}
333 #footnotes .footnote:last-of-type{margin-bottom:0}
334 #content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0}
335 .gist .file-data>table{border:0;background:#fff;width:100%;margin-bottom:0}
336 .gist .file-data>table td.line-data{width:99%}
337 div.unbreakable{page-break-inside:avoid}
338 .big{font-size:larger}
339 .small{font-size:smaller}
340 .underline{text-decoration:underline}
341 .overline{text-decoration:overline}
342 .line-through{text-decoration:line-through}
343 .aqua{color:#00bfbf}
344 .aqua-background{background-color:#00fafa}
345 .black{color:#000}
346 .black-background{background-color:#000}
347 .blue{color:#0000bf}
348 .blue-background{background-color:#0000fa}
349 .fuchsia{color:#bf00bf}
350 .fuchsia-background{background-color:#fa00fa}
351 .gray{color:#606060}
352 .gray-background{background-color:#7d7d7d}
353 .green{color:#006000}
354 .green-background{background-color:#007d00}
355 .lime{color:#00bf00}
356 .lime-background{background-color:#00fa00}
357 .maroon{color:#600000}
358 .maroon-background{background-color:#7d0000}
359 .navy{color:#000060}
360 .navy-background{background-color:#00007d}
361 .olive{color:#606000}
362 .olive-background{background-color:#7d7d00}
363 .purple{color:#600060}
364 .purple-background{background-color:#7d007d}
365 .red{color:#bf0000}
366 .red-background{background-color:#fa0000}
367 .silver{color:#909090}
368 .silver-background{background-color:#bcbcbc}
369 .teal{color:#006060}
370 .teal-background{background-color:#007d7d}
371 .white{color:#bfbfbf}
372 .white-background{background-color:#fafafa}
373 .yellow{color:#bfbf00}
374 .yellow-background{background-color:#fafa00}
375 span.icon>.fa{cursor:default}
376 a span.icon>.fa{cursor:inherit}
377 .admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default}
378 .admonitionblock td.icon .icon-note::before{content:"\f05a";color:#19407c}
379 .admonitionblock td.icon .icon-tip::before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111}
380 .admonitionblock td.icon .icon-warning::before{content:"\f071";color:#bf6900}
381 .admonitionblock td.icon .icon-caution::before{content:"\f06d";color:#bf3400}
382 .admonitionblock td.icon .icon-important::before{content:"\f06a";color:#bf0000}
383 .conum[data-value]{display:inline-block;color:#fff!important;background-color:rgba(0,0,0,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}
384 .conum[data-value] *{color:#fff!important}
385 .conum[data-value]+b{display:none}
386 .conum[data-value]::after{content:attr(data-value)}
387 pre .conum[data-value]{position:relative;top:-.125em}
388 b.conum *{color:inherit!important}
389 .conum:not([data-value]):empty{display:none}
390 dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
391 h1,h2,p,td.content,span.alt{letter-spacing:-.01em}
392 p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
393 p,blockquote,dt,td.content,span.alt{font-size:1.0625rem}
394 p{margin-bottom:1.25rem}
395 .sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
396 .exampleblock>.content{background-color:#fffef7;border-color:#e0e0dc;-webkit-box-shadow:0 1px 4px #e0e0dc;box-shadow:0 1px 4px #e0e0dc}
397 .print-only{display:none!important}
398 @page{margin:1.25cm .75cm}
399 @media print{*{-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:none!important}
400 html{font-size:80%}
401 a{color:inherit!important;text-decoration:underline!important}
402 a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important}
403 a[href^="http:"]:not(.bare)::after,a[href^="https:"]:not(.bare)::after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}
404 abbr[title]::after{content:" (" attr(title) ")"}
405 pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
406 thead{display:table-header-group}
407 svg{max-width:100%}
408 p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3}
409 h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid}
410 #toc,.sidebarblock,.exampleblock>.content{background:none!important}
411 #toc{border-bottom:1px solid #dddddf!important;padding-bottom:0!important}
412 body.book #header{text-align:center}
413 body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em}
414 body.book #header .details{border:0!important;display:block;padding:0!important}
415 body.book #header .details span:first-child{margin-left:0!important}
416 body.book #header .details br{display:block}
417 body.book #header .details br+span::before{content:none!important}
418 body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important}
419 body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always}
420 .listingblock code[data-lang]::before{display:block}
421 #footer{padding:0 .9375em}
422 .hide-on-print{display:none!important}
423 .print-only{display:block!important}
424 .hide-for-print{display:none!important}
425 .show-for-print{display:inherit!important}}
426 @media print,amzn-kf8{#header>h1:first-child{margin-top:1.25rem}
427 .sect1{padding:0!important}
428 .sect1+.sect1{border:0}
429 #footer{background:none}
430 #footer-text{color:rgba(0,0,0,.6);font-size:.9em}}
431 @media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}}
432 </style>
433 </head>
434 <body class="article toc2 toc-left">
435 <div id="header">
436 <h1>Boost.System: Extensible Error Reporting</h1>
437 <div class="details">
438 <span id="author" class="author">Beman Dawes, Christopher Kohlhoff, Peter Dimov</span><br>
439 </div>
440 <div id="toc" class="toc2">
441 <div id="toctitle">Table of Contents</div>
442 <ul class="sectlevel1">
443 <li><a href="#introduction">Introduction</a></li>
444 <li><a href="#changes">Release History</a>
445 <ul class="sectlevel2">
446 <li><a href="#changes_in_boost_1_69">Changes in Boost 1.69</a></li>
447 <li><a href="#changes_in_boost_1_68">Changes in Boost 1.68</a></li>
448 <li><a href="#changes_in_boost_1_65">Changes in Boost 1.65</a></li>
449 </ul>
450 </li>
451 <li><a href="#rationale">Design Rationale</a></li>
452 <li><a href="#reference">Reference</a>
453 <ul class="sectlevel2">
454 <li><a href="#ref_use_of_c11_and_c14_features">Use of C&#43;&#43;11 and C&#43;&#43;14 Features</a></li>
455 <li><a href="#ref_macros">Macros</a></li>
456 <li><a href="#ref_deprecated_names">Deprecated Names</a></li>
457 <li><a href="#ref_boostsystemerror_code_hpp">&lt;boost/system/error_code.hpp&gt;</a>
458 <ul class="sectlevel3">
459 <li><a href="#ref_synopsis">Synopsis</a></li>
460 <li><a href="#ref_class_error_category">Class error_category</a></li>
461 <li><a href="#ref_predefined_categories">Predefined Categories</a></li>
462 <li><a href="#ref_class_error_code">Class error_code</a></li>
463 <li><a href="#ref_class_error_condition">Class error_condition</a></li>
464 <li><a href="#ref_nonmember_functions">Nonmember functions</a></li>
465 </ul>
466 </li>
467 <li><a href="#ref_boostsystemsystem_error_hpp">&lt;boost/system/system_error.hpp&gt;</a>
468 <ul class="sectlevel3">
469 <li><a href="#ref_class_system_error">Class system_error</a></li>
470 </ul>
471 </li>
472 </ul>
473 </li>
474 <li><a href="#history">History</a></li>
475 <li><a href="#acknowledgments">Acknowledgments</a></li>
476 <li><a href="#copyright">Copyright and License</a></li>
477 </ul>
478 </div>
479 </div>
480 <div id="content">
481 <div class="sect1">
482 <h2 id="introduction">Introduction</h2>
483 <div class="sectionbody">
484 <div class="paragraph">
485 <p>Error conditions originating from the operating system or other low-level
486 application program interfaces (API&#8217;s) are typically reported via an integer
487 representing an error code. When these low-level API calls are wrapped in
488 portable code, such as in a portable library, some users want to deal with the
489 error codes in portable ways. Other users need to get at the system specific
490 error codes, so they can deal with system specific needs. The Boost System
491 library provides simple, light-weight <code>error_code</code> objects that encapsulate
492 system-specific error code values, yet also provide access to more abstract
493 and portable error conditions via <code>error_condition</code> objects.</p>
494 </div>
495 <div class="paragraph">
496 <p>Because <code>error_code</code> objects can represent errors from sources other than the
497 operating system, including user-defined sources, each <code>error_code</code> and
498 <code>error_condition</code> has an associated <code>error_category</code>.</p>
499 </div>
500 <div class="paragraph">
501 <p>An exception class, <code>system_error</code>, is provided. Derived from
502 <code>std::runtime_error</code>, it captures the underlying <code>error_code</code> for the problem
503 causing the exception so that this important information is not lost.</p>
504 </div>
505 <div class="paragraph">
506 <p>While exceptions are the preferred C&#43;&#43; default error code reporting
507 mechanism, users of libraries dependent on low-level API&#8217;s often need overloads
508 reporting error conditions via error code arguments and/or return values rather
509 than via throwing exceptions. Otherwise, when errors are not exceptional
510 occurrences and must be dealt with as they arise, programs become littered with
511 try/catch blocks, unreadable, and inefficient. The Boost System library
512 supports both error reporting by exception and by error code.</p>
513 </div>
514 <div class="paragraph">
515 <p>In addition to portable errors codes and conditions supported by the
516 <code>error_code.hpp</code> header, system-specific headers support the Cygwin, Linux,
517 and Windows platforms. These headers are effectively no-ops if included for
518 platforms other than their intended target.</p>
519 </div>
520 <div class="paragraph">
521 <p>Boost.System is part of the C&#43;&#43;11 Standard Library.
522 A number of changes, particularly to names, were made by the C++ committee
523 during standardization. The Boost implementation has been tracking those changes.
524 See <a href="#ref_deprecated_names">Deprecated Names</a> for synonyms provided to prevent
525 breakage of existing user code.</p>
526 </div>
527 </div>
528 </div>
529 <div class="sect1">
530 <h2 id="changes">Release History</h2>
531 <div class="sectionbody">
532 <div class="sect2">
533 <h3 id="changes_in_boost_1_69">Changes in Boost 1.69</h3>
534 <div class="ulist">
535 <ul>
536 <li>
537 <p>Boost.System is now header-only. A stub library is still built for
538 compatibility, but linking to it is no longer necessary.</p>
539 </li>
540 <li>
541 <p>Even more functions have been marked <code>constexpr</code>.</p>
542 </li>
543 <li>
544 <p>The destructor of <code>error_category</code> is now protected and no longer
545 virtual. This is a <em>potentially breaking change</em> but its impact
546 is expected to be limited.</p>
547 </li>
548 <li>
549 <p><code>error_category</code> now has a constructor that accepts a 64 bit identifier,
550 enabling distinct category objects to compare equal.</p>
551 </li>
552 <li>
553 <p>The constructors of <code>error_category</code> are now protected.</p>
554 </li>
555 <li>
556 <p>A non-allocating, nonthrowing overload of <code>message</code> has been added.</p>
557 </li>
558 <li>
559 <p>A virtual function <code>failed</code> has been added, allowing categories for
560 which success is not synonymous with 0.</p>
561 </li>
562 <li>
563 <p>The deprecated <code>boost::system::throws</code> object has been removed.</p>
564 </li>
565 <li>
566 <p><code>boost::throws()</code> is now deprecated and its use is discouraged.</p>
567 </li>
568 <li>
569 <p>The constructor of <code>system_error</code> taking a single <code>error_code</code> argument
570 is now explicit.</p>
571 </li>
572 <li>
573 <p><code>system_error::code()</code> now returns by value.</p>
574 </li>
575 </ul>
576 </div>
577 </div>
578 <div class="sect2">
579 <h3 id="changes_in_boost_1_68">Changes in Boost 1.68</h3>
580 <div class="paragraph">
581 <p>On a C&#43;&#43;14 compiler, many Boost.System functions and member functions
582 are now <code>constexpr</code>, and <code>error_code</code> and <code>error_condition</code> are literal
583 classes.</p>
584 </div>
585 <div class="paragraph">
586 <p>In addition to enabling use in constant expressions (and <code>constexpr</code>
587 functions), this significantly improves the quality of the generated code.</p>
588 </div>
589 <div class="paragraph">
590 <p>As a result of this change, however, now using Boost.System from C&#43;&#43;14
591 or C&#43;&#43;17 code requires that the library be also built with C&#43;&#43;14 or
592 above. This is the default on GCC 6 and newer, but not on GCC 5 or Clang.
593 One can build Boost for C&#43;&#43;14 by passing the <code>cxxstd=14</code> option to <code>b2</code>.</p>
594 </div>
595 <div class="paragraph">
596 <p>(Previous versions allowed code built against any C&#43;&#43; standard to link
597 with Boost.System built against any C&#43;&#43; standard. In 1.68, code using
598 any C&#43;&#43; standard can link with Boost.System built with C&#43;&#43;14 or above,
599 but if Boost.System is built with C&#43;&#43;11 or below, only code also built
600 with C&#43;&#43;11 and below can link to it successfully.)</p>
601 </div>
602 </div>
603 <div class="sect2">
604 <h3 id="changes_in_boost_1_65">Changes in Boost 1.65</h3>
605 <div class="paragraph">
606 <p>On a C&#43;&#43;11 compiler, Boost.System now provides implicit conversions
607 from <code>boost::system::error_category</code>, <code>error_code</code>, and <code>error_condition</code>
608 to their standard equivalents from <code>&lt;system_error&gt;</code>.</p>
609 </div>
610 <div class="paragraph">
611 <p>This allows libraries to expose a C&#43;&#43;11 interface and report errors
612 via <code>std::error_code</code> even when using Boost.System, directly or through a
613 dependency such as Boost.ASIO.</p>
614 </div>
615 </div>
616 </div>
617 </div>
618 <div class="sect1">
619 <h2 id="rationale">Design Rationale</h2>
620 <div class="sectionbody">
621 <div class="paragraph">
622 <p><code>error_code</code> and <code>error_condition</code> are designed as value types so
623 they can be copied without slicing and do not require heap allocation, but
624 still have polymorphic behavior based on the error category. This is achieved
625 by abstract base class <code>error_category</code> supplying the polymorphic behavior,
626 and <code>error_code</code> and <code>error_condition</code> containing a pointer to an object of a
627 type derived from <code>error_category</code>.</p>
628 </div>
629 <div class="paragraph">
630 <p>Many of the detailed design decisions were driven by the requirements that
631 users to be able to add additional error categories, and that it be no more
632 difficult to write portable code than system-specific code.</p>
633 </div>
634 <div class="paragraph">
635 <p>The <code>operator&lt;&lt;</code> overload for <code>error_code</code> eliminates a misleading conversion to
636 <code>bool</code> in code like <code>cout &lt;&lt; ec</code>, where <code>ec</code> is of type <code>error_code</code>. It is also
637 useful in its own right.</p>
638 </div>
639 </div>
640 </div>
641 <div class="sect1">
642 <h2 id="reference">Reference</h2>
643 <div class="sectionbody">
644 <div class="sect2">
645 <h3 id="ref_use_of_c11_and_c14_features">Use of C&#43;&#43;11 and C&#43;&#43;14 Features</h3>
646 <div class="paragraph">
647 <p>The library is documented to use several C&#43;&#43;11 and C&#43;&#43;14 features,
648 including <code>noexcept</code>, explicit conversion operators and <code>constexpr</code>. The
649 actual implementation uses C&#43;&#43;11 and C&#43;&#43;14 features only when they are
650 available, and otherwise falls back on C&#43;&#43;03 features.</p>
651 </div>
652 </div>
653 <div class="sect2">
654 <h3 id="ref_macros">Macros</h3>
655 <div class="paragraph">
656 <p>When <code>BOOST_SYSTEM_ENABLE_DEPRECATED</code> is defined, the library provides
657 deprecated features for compatibility. These features are bound to eventually
658 disappear.</p>
659 </div>
660 <div class="paragraph">
661 <p>When <code>BOOST_SYSTEM_USE_UTF8</code> is defined, on Windows the library returns
662 UTF-8 messages using code page <code>CP_UTF8</code> instead of the default <code>CP_ACP</code>.
663 This macro has no effect on POSIX.</p>
664 </div>
665 </div>
666 <div class="sect2">
667 <h3 id="ref_deprecated_names">Deprecated Names</h3>
668 <div class="paragraph">
669 <p>In the process of adding Boost.System to the C&#43;&#43;11 standard library, the
670 C&#43;&#43; committee changed some names. To ease transition, Boost.System deprecates
671 the old names, but will provide them when the macro <code>BOOST_SYSTEM_ENABLE_DEPRECATED</code> is defined.</p>
672 </div>
673 <table class="tableblock frame-all grid-all stretch">
674 <colgroup>
675 <col style="width: 50%;">
676 <col style="width: 50%;">
677 </colgroup>
678 <thead>
679 <tr>
680 <th class="tableblock halign-left valign-top">Old usage, now deprecated</th>
681 <th class="tableblock halign-left valign-top">Replacement</th>
682 </tr>
683 </thead>
684 <tbody>
685 <tr>
686 <td class="tableblock halign-left valign-top"><p class="tableblock"><code>get_generic_category()</code></p></td>
687 <td class="tableblock halign-left valign-top"><p class="tableblock"><code>generic_category()</code></p></td>
688 </tr>
689 <tr>
690 <td class="tableblock halign-left valign-top"><p class="tableblock"><code>get_system_category()</code></p></td>
691 <td class="tableblock halign-left valign-top"><p class="tableblock"><code>system_category()</code></p></td>
692 </tr>
693 <tr>
694 <td class="tableblock halign-left valign-top"><p class="tableblock"><code>namespace posix</code></p></td>
695 <td class="tableblock halign-left valign-top"><p class="tableblock"><code>namespace errc</code></p></td>
696 </tr>
697 <tr>
698 <td class="tableblock halign-left valign-top"><p class="tableblock"><code>namespace posix_error</code></p></td>
699 <td class="tableblock halign-left valign-top"><p class="tableblock"><code>namespace errc</code></p></td>
700 </tr>
701 <tr>
702 <td class="tableblock halign-left valign-top"><p class="tableblock"><code>get_posix_category()</code></p></td>
703 <td class="tableblock halign-left valign-top"><p class="tableblock"><code>generic_category()</code></p></td>
704 </tr>
705 <tr>
706 <td class="tableblock halign-left valign-top"><p class="tableblock"><code>posix_category</code></p></td>
707 <td class="tableblock halign-left valign-top"><p class="tableblock"><code>generic_category()</code></p></td>
708 </tr>
709 <tr>
710 <td class="tableblock halign-left valign-top"><p class="tableblock"><code>errno_ecat</code></p></td>
711 <td class="tableblock halign-left valign-top"><p class="tableblock"><code>generic_category()</code></p></td>
712 </tr>
713 <tr>
714 <td class="tableblock halign-left valign-top"><p class="tableblock"><code>native_ecat</code></p></td>
715 <td class="tableblock halign-left valign-top"><p class="tableblock"><code>system_category()</code></p></td>
716 </tr>
717 </tbody>
718 </table>
719 </div>
720 <div class="sect2">
721 <h3 id="ref_boostsystemerror_code_hpp">&lt;boost/system/error_code.hpp&gt;</h3>
722 <div class="sect3">
723 <h4 id="ref_synopsis">Synopsis</h4>
724 <div class="listingblock">
725 <div class="content">
726 <pre class="highlight"><code>namespace boost {
727   namespace system {
728
729     class error_category;
730
731     constexpr const error_category &amp; system_category() noexcept;
732     constexpr const error_category &amp; generic_category() noexcept;
733
734     class error_code;
735     class error_condition;
736
737     // "Concept" helpers
738
739     template&lt;class T&gt;
740       struct is_error_code_enum { static const bool value = false; };
741
742     template&lt;class T&gt;
743       struct is_error_condition_enum { static const bool value = false; };
744
745     // generic error conditions
746
747     namespace errc {
748       enum errc_t
749       {
750         success = 0,
751         address_family_not_supported,   //EAFNOSUPPORT
752         address_in_use,                 //EADDRINUSE
753         address_not_available,          //EADDRNOTAVAIL
754         already_connected,              //EISCONN
755         argument_list_too_long,         //E2BIG
756         argument_out_of_domain,         //EDOM
757         bad_address,                    //EFAULT
758         bad_file_descriptor,            //EBADF
759         bad_message,                    //EBADMSG
760         broken_pipe,                    //EPIPE
761         connection_aborted,             //ECONNABORTED
762         connection_already_in_progress, //EALREADY
763         connection_refused,             //ECONNREFUSED
764         connection_reset,               //ECONNRESET
765         cross_device_link,              //EXDEV
766         destination_address_required,   //EDESTADDRREQ
767         device_or_resource_busy,        //EBUSY
768         directory_not_empty,            //ENOTEMPTY
769         executable_format_error,        //ENOEXEC
770         file_exists,                    //EEXIST
771         file_too_large,                 //EFBIG
772         filename_too_long,              //ENAMETOOLONG
773         function_not_supported,         //ENOSYS
774         host_unreachable,               //EHOSTUNREACH
775         identifier_removed,             //EIDRM
776         illegal_byte_sequence,          //EILSEQ
777         inappropriate_io_control_operation, //ENOTTY
778         interrupted,                    //EINTR
779         invalid_argument,               //EINVAL
780         invalid_seek,                   //ESPIPE
781         io_error,                       //EIO
782         is_a_directory,                 //EISDIR
783         message_size,                   //EMSGSIZE
784         network_down,                   //ENETDOWN
785         network_reset,                  //ENETRESET
786         network_unreachable,            //ENETUNREACH
787         no_buffer_space,                //ENOBUFS
788         no_child_process,               //ECHILD
789         no_link,                        //ENOLINK
790         no_lock_available,              //ENOLCK
791         no_message_available,           //ENODATA
792         no_message,                     //ENOMSG
793         no_protocol_option,             //ENOPROTOOPT
794         no_space_on_device,             //ENOSPC
795         no_stream_resources,            //ENOSR
796         no_such_device_or_address,      //ENXIO
797         no_such_device,                 //ENODEV
798         no_such_file_or_directory,      //ENOENT
799         no_such_process,                //ESRCH
800         not_a_directory,                //ENOTDIR
801         not_a_socket,                   //ENOTSOCK
802         not_a_stream,                   //ENOSTR
803         not_connected,                  //ENOTCONN
804         not_enough_memory,              //ENOMEM
805         not_supported,                  //ENOTSUP
806         operation_canceled,             //ECANCELED
807         operation_in_progress,          //EINPROGRESS
808         operation_not_permitted,        //EPERM
809         operation_not_supported,        //EOPNOTSUPP
810         operation_would_block,          //EWOULDBLOCK
811         owner_dead,                     //EOWNERDEAD
812         permission_denied,              //EACCES
813         protocol_error,                 //EPROTO
814         protocol_not_supported,         //EPROTONOSUPPORT
815         read_only_file_system,          //EROFS
816         resource_deadlock_would_occur,  //EDEADLK
817         resource_unavailable_try_again, //EAGAIN
818         result_out_of_range,            //ERANGE
819         state_not_recoverable,          //ENOTRECOVERABLE
820         stream_timeout,                 //ETIME
821         text_file_busy,                 //ETXTBSY
822         timed_out,                      //ETIMEDOUT
823         too_many_files_open_in_system,  //ENFILE
824         too_many_files_open,            //EMFILE
825         too_many_links,                 //EMLINK
826         too_many_synbolic_link_levels,  //ELOOP
827         value_too_large,                //EOVERFLOW
828         wrong_protocol_type             //EPROTOTYPE
829       };
830
831     } // namespace errc
832
833     template&lt;&gt; struct is_error_condition_enum&lt;errc::errc_t&gt;
834       { static const bool value = true; };
835
836     // non-member functions
837
838     constexpr bool operator==( const error_code &amp; lhs,
839       const error_code &amp; rhs ) noexcept;
840     bool operator==( const error_code &amp; code,
841       const error_condition &amp; condition ) noexcept;
842     bool operator==( const error_condition &amp; condition,
843       const error_code &amp; code ) noexcept;
844     constexpr bool operator==( const error_condition &amp; lhs,
845       const error_condition &amp; rhs ) noexcept;
846
847     constexpr bool operator!=( const error_code &amp; lhs,
848       const error_code &amp; rhs ) noexcept;
849     bool operator!=( const error_code &amp; code,
850       const error_condition &amp; condition ) noexcept;
851     bool operator!=( const error_condition &amp; condition,
852       const error_code &amp; code ) noexcept;
853     constexpr bool operator!=( const error_condition &amp; lhs,
854       const error_condition &amp; rhs ) noexcept;
855
856     constexpr bool operator&lt;( const error_code &amp; lhs,
857       const error_code &amp; rhs ) noexcept;
858     constexpr bool operator&lt;( const error_condition &amp; lhs,
859       const error_condition &amp; rhs ) noexcept;
860
861     constexpr error_code make_error_code( errc::errc_t e ) noexcept;
862     constexpr error_condition make_error_condition( errc::errc_t e ) noexcept;
863
864     template &lt;class charT, class traits&gt;
865       std::basic_ostream&lt;charT, traits&gt;&amp;
866         operator&lt;&lt;( basic_ostream&lt;charT, traits&gt;&amp; os, const error_code &amp; ec );
867
868     std::size_t hash_value( const error_code &amp; ec );
869
870   } // namespace system
871 } // namespace boost</code></pre>
872 </div>
873 </div>
874 <div class="paragraph">
875 <p>The value of each <code>errc_t</code> constant is the same as the value of the <code>&lt;cerrno&gt;</code>
876 macro shown in the above synopsis.</p>
877 </div>
878 <div class="paragraph">
879 <p>Users may specialize <code>is_error_code_enum</code> and <code>is_error_condition_enum</code>
880 templates to indicate that a type is eligible for class <code>error_code</code> and
881 <code>error_condition</code> automatic conversions respectively.</p>
882 </div>
883 </div>
884 <div class="sect3">
885 <h4 id="ref_class_error_category">Class error_category</h4>
886 <div class="paragraph">
887 <p>The class <code>error_category</code> defines the base class for types used
888 to identify the source and encoding of a particular category of error code.</p>
889 </div>
890 <div class="paragraph">
891 <p>Classes may be derived from <code>error_category</code> to support categories of
892 errors in addition to those defined in Boost.System.</p>
893 </div>
894 <div class="listingblock">
895 <div class="content">
896 <pre class="highlight"><code>namespace boost {
897   namespace system {
898
899     class error_category
900     {
901     public: // noncopyable
902
903       error_category( error_category const &amp; ) = delete;
904       error_category&amp; operator=( error_category const &amp; ) = delete;
905
906     protected:
907
908       ~error_category() = default;
909
910       constexpr error_category() noexcept;
911       explicit constexpr error_category( unsigned long long id ) noexcept;
912
913     public:
914
915       virtual const char * name() const noexcept = 0;
916
917       virtual error_condition default_error_condition( int ev ) const noexcept;
918
919       virtual bool equivalent( int code, const error_condition &amp; condition )
920         const noexcept;
921       virtual bool equivalent( const error_code &amp; code, int condition )
922         const noexcept;
923
924       virtual std::string message( int ev ) const = 0;
925       virtual char const * message( int ev, char * buffer, std::size_t len )
926         const noexcept;
927
928       virtual bool failed( int ev ) const noexcept;
929
930       constexpr bool operator==( const error_category &amp; rhs ) const noexcept;
931       constexpr bool operator!=( const error_category &amp; rhs ) const noexcept;
932       constexpr bool operator&lt; ( const error_category &amp; rhs ) const noexcept;
933
934       operator std::error_category const &amp; () const;
935
936     private:
937
938       unsigned long long id_; // exposition only
939
940     };
941   }
942 }</code></pre>
943 </div>
944 </div>
945 <div class="sect4">
946 <h5 id="ref_constructors">Constructors</h5>
947 <div class="listingblock">
948 <div class="content">
949 <pre class="highlight"><code>constexpr error_category() noexcept;</code></pre>
950 </div>
951 </div>
952 <div class="ulist none">
953 <ul class="none">
954 <li>
955 <p></p>
956 <div class="dlist">
957 <dl>
958 <dt class="hdlist1">Effects: </dt>
959 <dd>
960 <p>Initializes <code>id_</code> to 0.</p>
961 </dd>
962 <dt class="hdlist1">Remarks: </dt>
963 <dd>
964 <p>Since equivalence for categories that do not have an identifier is
965 based on comparing object addresses, a user-defined derived category of type
966 <code>C</code> that uses this constructor should ensure that only one object of type <code>C</code>
967 exists in the program.</p>
968 </dd>
969 </dl>
970 </div>
971 </li>
972 </ul>
973 </div>
974 <div class="listingblock">
975 <div class="content">
976 <pre class="highlight"><code>explicit constexpr error_category( unsigned long long id ) noexcept;</code></pre>
977 </div>
978 </div>
979 <div class="ulist none">
980 <ul class="none">
981 <li>
982 <p></p>
983 <div class="dlist">
984 <dl>
985 <dt class="hdlist1">Effects: </dt>
986 <dd>
987 <p>Initializes <code>id_</code> to <code>id</code>.</p>
988 </dd>
989 <dt class="hdlist1">Remarks: </dt>
990 <dd>
991 <p>User-defined derived categories that use this constructor are considered
992 equivalent when their identifiers match. Therefore, those categories may have more
993 than one instance existing in a program, but to minimize the possibility of
994 collision, their identifiers must be randomly chosen (at the time the category
995 is implemented, not at runtime). One way of generating a 64 bit random identifier
996 is <a href="https://www.random.org/cgi-bin/randbyte?nbytes=8&amp;format=h" class="bare">https://www.random.org/cgi-bin/randbyte?nbytes=8&amp;format=h</a>.</p>
997 </dd>
998 </dl>
999 </div>
1000 </li>
1001 </ul>
1002 </div>
1003 </div>
1004 <div class="sect4">
1005 <h5 id="ref_virtuals">Virtuals</h5>
1006 <div class="listingblock">
1007 <div class="content">
1008 <pre class="highlight"><code>virtual const char * name() const noexcept = 0;</code></pre>
1009 </div>
1010 </div>
1011 <div class="ulist none">
1012 <ul class="none">
1013 <li>
1014 <p></p>
1015 <div class="dlist">
1016 <dl>
1017 <dt class="hdlist1">Returns: </dt>
1018 <dd>
1019 <p>In derived classes, a character literal naming the error category.</p>
1020 </dd>
1021 </dl>
1022 </div>
1023 </li>
1024 </ul>
1025 </div>
1026 <div class="listingblock">
1027 <div class="content">
1028 <pre class="highlight"><code>virtual error_condition default_error_condition( int ev ) const noexcept;</code></pre>
1029 </div>
1030 </div>
1031 <div class="ulist none">
1032 <ul class="none">
1033 <li>
1034 <p></p>
1035 <div class="dlist">
1036 <dl>
1037 <dt class="hdlist1">Returns: </dt>
1038 <dd>
1039 <div class="ulist">
1040 <ul>
1041 <li>
1042 <p>In derived classes, an error condition corresponding to <code>ev</code>.
1043 The returned error condition will typically come from the generic category.</p>
1044 </li>
1045 <li>
1046 <p>In the default implementation, <code>error_condition( ev, *this )</code>.</p>
1047 </li>
1048 </ul>
1049 </div>
1050 </dd>
1051 </dl>
1052 </div>
1053 </li>
1054 </ul>
1055 </div>
1056 <div class="listingblock">
1057 <div class="content">
1058 <pre class="highlight"><code>virtual bool equivalent( int code, const error_condition &amp; condition )
1059   const noexcept;</code></pre>
1060 </div>
1061 </div>
1062 <div class="ulist none">
1063 <ul class="none">
1064 <li>
1065 <p></p>
1066 <div class="dlist">
1067 <dl>
1068 <dt class="hdlist1">Returns: </dt>
1069 <dd>
1070 <div class="ulist">
1071 <ul>
1072 <li>
1073 <p>In derived classes, <code>true</code> when <code>error_code( code, *this )</code> is equivalent to <code>condition</code>.</p>
1074 </li>
1075 <li>
1076 <p>In the default implementation, <code>default_error_condition( code ) == condition</code>.</p>
1077 </li>
1078 </ul>
1079 </div>
1080 </dd>
1081 </dl>
1082 </div>
1083 </li>
1084 </ul>
1085 </div>
1086 <div class="listingblock">
1087 <div class="content">
1088 <pre class="highlight"><code>virtual bool equivalent( const error_code &amp; code, int condition )
1089   const noexcept;</code></pre>
1090 </div>
1091 </div>
1092 <div class="ulist none">
1093 <ul class="none">
1094 <li>
1095 <p></p>
1096 <div class="dlist">
1097 <dl>
1098 <dt class="hdlist1">Returns: </dt>
1099 <dd>
1100 <div class="ulist">
1101 <ul>
1102 <li>
1103 <p>In derived classes, <code>true</code> when <code>code</code> is equivalent to <code>error_condition( condition, *this )</code>.</p>
1104 </li>
1105 <li>
1106 <p>In the default implementation, <code>*this == code.category() &amp;&amp; code.value() == condition</code>.</p>
1107 </li>
1108 </ul>
1109 </div>
1110 </dd>
1111 </dl>
1112 </div>
1113 </li>
1114 </ul>
1115 </div>
1116 <div class="listingblock">
1117 <div class="content">
1118 <pre class="highlight"><code>virtual std::string message( int ev ) const = 0;</code></pre>
1119 </div>
1120 </div>
1121 <div class="ulist none">
1122 <ul class="none">
1123 <li>
1124 <p></p>
1125 <div class="dlist">
1126 <dl>
1127 <dt class="hdlist1">Returns: </dt>
1128 <dd>
1129 <p>In derived classes, a string that describes the error denoted by <code>ev</code>.</p>
1130 </dd>
1131 </dl>
1132 </div>
1133 </li>
1134 </ul>
1135 </div>
1136 <div class="listingblock">
1137 <div class="content">
1138 <pre class="highlight"><code>virtual char const * message( int ev, char * buffer, std::size_t len )
1139   const noexcept;</code></pre>
1140 </div>
1141 </div>
1142 <div class="ulist none">
1143 <ul class="none">
1144 <li>
1145 <p></p>
1146 <div class="dlist">
1147 <dl>
1148 <dt class="hdlist1">Effects: </dt>
1149 <dd>
1150 <div class="ulist">
1151 <ul>
1152 <li>
1153 <p>Derived classes should either</p>
1154 <div class="ulist">
1155 <ul>
1156 <li>
1157 <p>return a pointer to a character literal describing the error denoted by <code>ev</code>, or</p>
1158 </li>
1159 <li>
1160 <p>copy a string describing the error into <code>buffer</code>, truncating it to <code>len-1</code>
1161 characters and storing a null terminator, and return <code>buffer</code>. If <code>len</code> is 0,
1162 nothing is copied, but the function still returns <code>buffer</code>. Note that
1163 when <code>len</code> is 0, <code>buffer</code> may be <code>nullptr</code>.</p>
1164 </li>
1165 </ul>
1166 </div>
1167 </li>
1168 <li>
1169 <p>The default implementation calls <code>message(ev)</code> and copies the result into
1170 <code>buffer</code>, truncating it to <code>len-1</code> characters and storing a null terminator.
1171 If <code>len</code> is 0, copies nothing. Returns <code>buffer</code>. If <code>message(ev)</code> throws an
1172 exception, the string <code>"Message text unavailable"</code> is used.</p>
1173 </li>
1174 </ul>
1175 </div>
1176 </dd>
1177 <dt class="hdlist1">Example: </dt>
1178 <dd>
1179 <div class="listingblock">
1180 <div class="content">
1181 <pre class="highlight"><code>const char* my_category::message(int ev, char* buffer, size_t len) const noexcept
1182 {
1183   switch(ev)
1184   {
1185   case 0: return "no error";
1186   case 1: return "voltage out of range";
1187   case 2: return "impedance mismatch";
1188   case 31:
1189   case 32:
1190   case 33:
1191     std::snprintf(buffer, len, "component %d failure", ev-30);
1192     return buffer;
1193   default:
1194     std::snprintf(buffer, len, "unknown error %d", ev);
1195     return buffer;
1196   }
1197 }</code></pre>
1198 </div>
1199 </div>
1200 </dd>
1201 </dl>
1202 </div>
1203 </li>
1204 </ul>
1205 </div>
1206 <div class="listingblock">
1207 <div class="content">
1208 <pre class="highlight"><code>virtual bool failed( int ev ) const noexcept;</code></pre>
1209 </div>
1210 </div>
1211 <div class="ulist none">
1212 <ul class="none">
1213 <li>
1214 <p></p>
1215 <div class="dlist">
1216 <dl>
1217 <dt class="hdlist1">Returns: </dt>
1218 <dd>
1219 <div class="ulist">
1220 <ul>
1221 <li>
1222 <p>In derived classes, <code>true</code> when <code>ev</code> represents a failure.</p>
1223 </li>
1224 <li>
1225 <p>In the default implementation, <code>ev != 0</code>.</p>
1226 </li>
1227 </ul>
1228 </div>
1229 </dd>
1230 <dt class="hdlist1">Remarks: </dt>
1231 <dd>
1232 <p>All calls to this function with the same <code>ev</code> must return the same value.</p>
1233 </dd>
1234 </dl>
1235 </div>
1236 </li>
1237 </ul>
1238 </div>
1239 </div>
1240 <div class="sect4">
1241 <h5 id="ref_nonvirtuals">Nonvirtuals</h5>
1242 <div class="listingblock">
1243 <div class="content">
1244 <pre class="highlight"><code>constexpr bool operator==( const error_category &amp; rhs ) const noexcept;</code></pre>
1245 </div>
1246 </div>
1247 <div class="ulist none">
1248 <ul class="none">
1249 <li>
1250 <p></p>
1251 <div class="dlist">
1252 <dl>
1253 <dt class="hdlist1">Returns: </dt>
1254 <dd>
1255 <p><code>rhs.id_ == 0? this == &amp;rhs: id_ == rhs.id_</code>.</p>
1256 </dd>
1257 <dt class="hdlist1">Remarks: </dt>
1258 <dd>
1259 <p>Two category objects are considered equivalent when they have matching
1260 nonzero identifiers, or are the same object.</p>
1261 </dd>
1262 </dl>
1263 </div>
1264 </li>
1265 </ul>
1266 </div>
1267 <div class="listingblock">
1268 <div class="content">
1269 <pre class="highlight"><code>constexpr bool operator!=( const error_category &amp; rhs ) const noexcept;</code></pre>
1270 </div>
1271 </div>
1272 <div class="ulist none">
1273 <ul class="none">
1274 <li>
1275 <p></p>
1276 <div class="dlist">
1277 <dl>
1278 <dt class="hdlist1">Returns: </dt>
1279 <dd>
1280 <p><code>!( *this == rhs )</code>.</p>
1281 </dd>
1282 </dl>
1283 </div>
1284 </li>
1285 </ul>
1286 </div>
1287 <div class="listingblock">
1288 <div class="content">
1289 <pre class="highlight"><code>constexpr bool operator&lt; ( const error_category &amp; rhs ) const noexcept;</code></pre>
1290 </div>
1291 </div>
1292 <div class="ulist none">
1293 <ul class="none">
1294 <li>
1295 <p></p>
1296 <div class="dlist">
1297 <dl>
1298 <dt class="hdlist1">Returns: </dt>
1299 <dd>
1300 <div class="ulist">
1301 <ul>
1302 <li>
1303 <p>If <code>id_ &lt; rhs.id_</code>, <code>true</code>;</p>
1304 </li>
1305 <li>
1306 <p>Otherwise, if <code>id_ &gt; rhs.id_</code>, <code>false</code>;</p>
1307 </li>
1308 <li>
1309 <p>Otherwise, if <code>rhs.id_ != 0</code>, <code>false</code>;</p>
1310 </li>
1311 <li>
1312 <p>Otherwise, <code>std::less&lt;error_category const *&gt;()( this, &amp;rhs )</code>.</p>
1313 </li>
1314 </ul>
1315 </div>
1316 </dd>
1317 </dl>
1318 </div>
1319 </li>
1320 </ul>
1321 </div>
1322 <div class="listingblock">
1323 <div class="content">
1324 <pre class="highlight"><code>operator std::error_category const &amp; () const;</code></pre>
1325 </div>
1326 </div>
1327 <div class="ulist none">
1328 <ul class="none">
1329 <li>
1330 <p></p>
1331 <div class="dlist">
1332 <dl>
1333 <dt class="hdlist1">Returns: </dt>
1334 <dd>
1335 <p>A reference to an <code>std::error_category</code> object corresponding
1336 to <code>*this</code>.</p>
1337 </dd>
1338 </dl>
1339 </div>
1340 </li>
1341 </ul>
1342 </div>
1343 </div>
1344 </div>
1345 <div class="sect3">
1346 <h4 id="ref_predefined_categories">Predefined Categories</h4>
1347 <div class="listingblock">
1348 <div class="content">
1349 <pre class="highlight"><code>constexpr const error_category &amp; system_category() noexcept;</code></pre>
1350 </div>
1351 </div>
1352 <div class="ulist none">
1353 <ul class="none">
1354 <li>
1355 <p></p>
1356 <div class="dlist">
1357 <dl>
1358 <dt class="hdlist1">Returns: </dt>
1359 <dd>
1360 <p>A reference to an <code>error_category</code> object identifying errors
1361 originating from the operating system.</p>
1362 </dd>
1363 </dl>
1364 </div>
1365 </li>
1366 </ul>
1367 </div>
1368 <div class="listingblock">
1369 <div class="content">
1370 <pre class="highlight"><code>constexpr const error_category &amp; generic_category() noexcept;</code></pre>
1371 </div>
1372 </div>
1373 <div class="ulist none">
1374 <ul class="none">
1375 <li>
1376 <p></p>
1377 <div class="dlist">
1378 <dl>
1379 <dt class="hdlist1">Returns: </dt>
1380 <dd>
1381 <p>A reference to an <code>error_category</code> object identifying portable
1382 error conditions.</p>
1383 </dd>
1384 </dl>
1385 </div>
1386 </li>
1387 </ul>
1388 </div>
1389 </div>
1390 <div class="sect3">
1391 <h4 id="ref_class_error_code">Class error_code</h4>
1392 <div class="paragraph">
1393 <p>The class <code>error_code</code> describes an object used to hold error code
1394 values, such as those originating from the operating system or other
1395 low-level application program interfaces. It&#8217;s an adjunct to error reporting
1396 by exception.</p>
1397 </div>
1398 <div class="listingblock">
1399 <div class="content">
1400 <pre class="highlight"><code>namespace boost {
1401   namespace system {
1402
1403     class error_code {
1404     public:
1405
1406       // constructors:
1407
1408       constexpr error_code() noexcept;
1409       constexpr error_code( int val, const error_category &amp; cat ) noexcept;
1410
1411       template &lt;class ErrorCodeEnum&gt;
1412         constexpr error_code( ErrorCodeEnum e ) noexcept;
1413
1414       // modifiers:
1415
1416       constexpr void assign( int val, const error_category &amp; cat ) noexcept;
1417
1418       template&lt;typename ErrorCodeEnum&gt;
1419         constexpr error_code &amp; operator=( ErrorCodeEnum e ) noexcept;
1420
1421       constexpr void clear() noexcept;
1422
1423       // observers:
1424
1425       constexpr int value() const noexcept;
1426       constexpr const error_category &amp; category() const noexcept;
1427
1428       error_condition default_error_condition() const noexcept;
1429
1430       std::string message() const;
1431       char const * message( char * buffer, std::size_t len ) const noexcept;
1432
1433       constexpr bool failed() const noexcept;
1434       constexpr explicit operator bool() const noexcept;
1435
1436       operator std::error_code() const;
1437
1438     private: // exposition only
1439
1440       int val_;
1441       const error_category * cat_;
1442
1443     };
1444   }
1445 }</code></pre>
1446 </div>
1447 </div>
1448 <div class="sect4">
1449 <h5 id="ref_constructors_2">Constructors</h5>
1450 <div class="listingblock">
1451 <div class="content">
1452 <pre class="highlight"><code>constexpr error_code() noexcept;</code></pre>
1453 </div>
1454 </div>
1455 <div class="ulist none">
1456 <ul class="none">
1457 <li>
1458 <p></p>
1459 <div class="dlist">
1460 <dl>
1461 <dt class="hdlist1">Ensures: </dt>
1462 <dd>
1463 <p><code>val_ == 0</code>; <code>*cat_ == system_category()</code>.</p>
1464 </dd>
1465 </dl>
1466 </div>
1467 </li>
1468 </ul>
1469 </div>
1470 <div class="listingblock">
1471 <div class="content">
1472 <pre class="highlight"><code>constexpr error_code( int val, const error_category &amp; cat ) noexcept;</code></pre>
1473 </div>
1474 </div>
1475 <div class="ulist none">
1476 <ul class="none">
1477 <li>
1478 <p></p>
1479 <div class="dlist">
1480 <dl>
1481 <dt class="hdlist1">Ensures: </dt>
1482 <dd>
1483 <p><code>val_ == val</code>; <code>cat_ == &amp;cat</code>.</p>
1484 </dd>
1485 </dl>
1486 </div>
1487 </li>
1488 </ul>
1489 </div>
1490 <div class="listingblock">
1491 <div class="content">
1492 <pre class="highlight"><code>template &lt;class ErrorCodeEnum&gt;
1493   constexpr error_code( ErrorCodeEnum e ) noexcept;</code></pre>
1494 </div>
1495 </div>
1496 <div class="ulist none">
1497 <ul class="none">
1498 <li>
1499 <p></p>
1500 <div class="dlist">
1501 <dl>
1502 <dt class="hdlist1">Ensures: </dt>
1503 <dd>
1504 <p><code>*this == make_error_code( e )</code>.</p>
1505 </dd>
1506 <dt class="hdlist1">Remarks: </dt>
1507 <dd>
1508 <p>This constructor is only enabled when <code>is_error_code_enum&lt;ErrorCodeEnum&gt;::value</code> is <code>true</code>.</p>
1509 </dd>
1510 </dl>
1511 </div>
1512 </li>
1513 </ul>
1514 </div>
1515 </div>
1516 <div class="sect4">
1517 <h5 id="ref_modifiers">Modifiers</h5>
1518 <div class="listingblock">
1519 <div class="content">
1520 <pre class="highlight"><code>constexpr void assign( int val, const error_category &amp; cat ) noexcept;</code></pre>
1521 </div>
1522 </div>
1523 <div class="ulist none">
1524 <ul class="none">
1525 <li>
1526 <p></p>
1527 <div class="dlist">
1528 <dl>
1529 <dt class="hdlist1">Ensures: </dt>
1530 <dd>
1531 <p><code>val_ == val</code>; <code>cat_ == &amp;cat</code>.</p>
1532 </dd>
1533 </dl>
1534 </div>
1535 </li>
1536 </ul>
1537 </div>
1538 <div class="listingblock">
1539 <div class="content">
1540 <pre class="highlight"><code>template&lt;typename ErrorCodeEnum&gt;
1541   constexpr error_code &amp; operator=( ErrorCodeEnum e ) noexcept;</code></pre>
1542 </div>
1543 </div>
1544 <div class="ulist none">
1545 <ul class="none">
1546 <li>
1547 <p></p>
1548 <div class="dlist">
1549 <dl>
1550 <dt class="hdlist1">Ensures: </dt>
1551 <dd>
1552 <p><code>*this == make_error_code( e )</code>.</p>
1553 </dd>
1554 <dt class="hdlist1">Remarks: </dt>
1555 <dd>
1556 <p>This operator is only enabled when <code>is_error_code_enum&lt;ErrorCodeEnum&gt;::value</code> is <code>true</code>.</p>
1557 </dd>
1558 </dl>
1559 </div>
1560 </li>
1561 </ul>
1562 </div>
1563 <div class="listingblock">
1564 <div class="content">
1565 <pre class="highlight"><code>constexpr void clear() noexcept;</code></pre>
1566 </div>
1567 </div>
1568 <div class="ulist none">
1569 <ul class="none">
1570 <li>
1571 <p></p>
1572 <div class="dlist">
1573 <dl>
1574 <dt class="hdlist1">Ensures: </dt>
1575 <dd>
1576 <p><code>val_ == 0</code>; <code>*cat_ == system_category()</code>.</p>
1577 </dd>
1578 </dl>
1579 </div>
1580 </li>
1581 </ul>
1582 </div>
1583 </div>
1584 <div class="sect4">
1585 <h5 id="ref_observers">Observers</h5>
1586 <div class="listingblock">
1587 <div class="content">
1588 <pre class="highlight"><code>constexpr int value() const noexcept;</code></pre>
1589 </div>
1590 </div>
1591 <div class="ulist none">
1592 <ul class="none">
1593 <li>
1594 <p></p>
1595 <div class="dlist">
1596 <dl>
1597 <dt class="hdlist1">Returns: </dt>
1598 <dd>
1599 <p><code>val_</code>.</p>
1600 </dd>
1601 </dl>
1602 </div>
1603 </li>
1604 </ul>
1605 </div>
1606 <div class="listingblock">
1607 <div class="content">
1608 <pre class="highlight"><code>constexpr const error_category &amp; category() const noexcept;</code></pre>
1609 </div>
1610 </div>
1611 <div class="ulist none">
1612 <ul class="none">
1613 <li>
1614 <p></p>
1615 <div class="dlist">
1616 <dl>
1617 <dt class="hdlist1">Returns: </dt>
1618 <dd>
1619 <p><code>*cat_</code>.</p>
1620 </dd>
1621 </dl>
1622 </div>
1623 </li>
1624 </ul>
1625 </div>
1626 <div class="listingblock">
1627 <div class="content">
1628 <pre class="highlight"><code>error_condition default_error_condition() const noexcept;</code></pre>
1629 </div>
1630 </div>
1631 <div class="ulist none">
1632 <ul class="none">
1633 <li>
1634 <p></p>
1635 <div class="dlist">
1636 <dl>
1637 <dt class="hdlist1">Returns: </dt>
1638 <dd>
1639 <p><code>cat_-&gt;default_error_condition( val_ )</code>.</p>
1640 </dd>
1641 </dl>
1642 </div>
1643 </li>
1644 </ul>
1645 </div>
1646 <div class="listingblock">
1647 <div class="content">
1648 <pre class="highlight"><code>std::string message() const;</code></pre>
1649 </div>
1650 </div>
1651 <div class="ulist none">
1652 <ul class="none">
1653 <li>
1654 <p></p>
1655 <div class="dlist">
1656 <dl>
1657 <dt class="hdlist1">Returns: </dt>
1658 <dd>
1659 <p><code>cat_-&gt;message( val_ )</code>.</p>
1660 </dd>
1661 </dl>
1662 </div>
1663 </li>
1664 </ul>
1665 </div>
1666 <div class="listingblock">
1667 <div class="content">
1668 <pre class="highlight"><code>char const * message( char * buffer, std::size_t len ) const noexcept;</code></pre>
1669 </div>
1670 </div>
1671 <div class="ulist none">
1672 <ul class="none">
1673 <li>
1674 <p></p>
1675 <div class="dlist">
1676 <dl>
1677 <dt class="hdlist1">Returns: </dt>
1678 <dd>
1679 <p><code>cat_-&gt;message( val_, buffer, len )</code>.</p>
1680 </dd>
1681 </dl>
1682 </div>
1683 </li>
1684 </ul>
1685 </div>
1686 <div class="listingblock">
1687 <div class="content">
1688 <pre class="highlight"><code>constexpr bool failed() const noexcept;</code></pre>
1689 </div>
1690 </div>
1691 <div class="ulist none">
1692 <ul class="none">
1693 <li>
1694 <p></p>
1695 <div class="dlist">
1696 <dl>
1697 <dt class="hdlist1">Returns: </dt>
1698 <dd>
1699 <p><code>cat_-&gt;failed( val_ )</code>.</p>
1700 </dd>
1701 </dl>
1702 </div>
1703 </li>
1704 </ul>
1705 </div>
1706 <div class="listingblock">
1707 <div class="content">
1708 <pre class="highlight"><code>constexpr explicit operator bool() const noexcept;</code></pre>
1709 </div>
1710 </div>
1711 <div class="ulist none">
1712 <ul class="none">
1713 <li>
1714 <p></p>
1715 <div class="dlist">
1716 <dl>
1717 <dt class="hdlist1">Returns: </dt>
1718 <dd>
1719 <p><code>val_ != 0</code>.</p>
1720 </dd>
1721 </dl>
1722 </div>
1723 </li>
1724 </ul>
1725 </div>
1726 <div class="listingblock">
1727 <div class="content">
1728 <pre class="highlight"><code>operator std::error_code() const;</code></pre>
1729 </div>
1730 </div>
1731 <div class="ulist none">
1732 <ul class="none">
1733 <li>
1734 <p></p>
1735 <div class="dlist">
1736 <dl>
1737 <dt class="hdlist1">Returns: </dt>
1738 <dd>
1739 <p><code>std::error_code( val_, *cat_ )</code>.</p>
1740 </dd>
1741 </dl>
1742 </div>
1743 </li>
1744 </ul>
1745 </div>
1746 </div>
1747 </div>
1748 <div class="sect3">
1749 <h4 id="ref_class_error_condition">Class error_condition</h4>
1750 <div class="listingblock">
1751 <div class="content">
1752 <pre class="highlight"><code>namespace boost {
1753   namespace system {
1754
1755     class error_condition {
1756     public:
1757
1758       // constructors:
1759
1760       constexpr error_condition() noexcept;
1761       constexpr error_condition( int val, const error_category &amp; cat ) noexcept;
1762
1763       template &lt;class ErrorConditionEnum&gt;
1764         constexpr error_condition( ErrorConditionEnum e ) noexcept;
1765
1766       // modifiers:
1767
1768       constexpr void assign( int val, const error_category &amp; cat ) noexcept;
1769
1770       template&lt;typename ErrorConditionEnum&gt;
1771         constexpr error_condition &amp; operator=( ErrorConditionEnum e ) noexcept;
1772
1773       constexpr void clear() noexcept;
1774
1775       // observers:
1776
1777       constexpr int value() const noexcept;
1778       constexpr const error_category &amp; category() const noexcept;
1779
1780       std::string message() const;
1781       char const * message( char * buffer, std::size_t len ) const noexcept;
1782
1783       constexpr bool failed() const noexcept;
1784       constexpr explicit operator bool() const noexcept;
1785
1786       operator std::error_condition() const;
1787
1788     private: // exposition only
1789
1790       int val_;
1791       const error_category * cat_;
1792
1793     };
1794   }
1795 }</code></pre>
1796 </div>
1797 </div>
1798 <div class="sect4">
1799 <h5 id="ref_constructors_3">Constructors</h5>
1800 <div class="listingblock">
1801 <div class="content">
1802 <pre class="highlight"><code>constexpr error_condition() noexcept;</code></pre>
1803 </div>
1804 </div>
1805 <div class="ulist none">
1806 <ul class="none">
1807 <li>
1808 <p></p>
1809 <div class="dlist">
1810 <dl>
1811 <dt class="hdlist1">Ensures: </dt>
1812 <dd>
1813 <p><code>val_ == 0</code>; <code>*cat_ == generic_category()</code>.</p>
1814 </dd>
1815 </dl>
1816 </div>
1817 </li>
1818 </ul>
1819 </div>
1820 <div class="listingblock">
1821 <div class="content">
1822 <pre class="highlight"><code>constexpr error_condition( int val, const error_category &amp; cat ) noexcept;</code></pre>
1823 </div>
1824 </div>
1825 <div class="ulist none">
1826 <ul class="none">
1827 <li>
1828 <p></p>
1829 <div class="dlist">
1830 <dl>
1831 <dt class="hdlist1">Ensures: </dt>
1832 <dd>
1833 <p><code>val_ == val</code>; <code>cat_ == &amp;cat</code>.</p>
1834 </dd>
1835 </dl>
1836 </div>
1837 </li>
1838 </ul>
1839 </div>
1840 <div class="listingblock">
1841 <div class="content">
1842 <pre class="highlight"><code>template &lt;class ErrorConditionEnum&gt;
1843   constexpr error_condition( ErrorConditionEnum e ) noexcept;</code></pre>
1844 </div>
1845 </div>
1846 <div class="ulist none">
1847 <ul class="none">
1848 <li>
1849 <p></p>
1850 <div class="dlist">
1851 <dl>
1852 <dt class="hdlist1">Ensures: </dt>
1853 <dd>
1854 <p><code>*this == make_error_condition( e )</code>.</p>
1855 </dd>
1856 <dt class="hdlist1">Remarks: </dt>
1857 <dd>
1858 <p>This constructor is only enabled when <code>is_error_condition_enum&lt;ErrorConditionEnum&gt;::value</code> is <code>true</code>.</p>
1859 </dd>
1860 </dl>
1861 </div>
1862 </li>
1863 </ul>
1864 </div>
1865 </div>
1866 <div class="sect4">
1867 <h5 id="ref_modifiers_2">Modifiers</h5>
1868 <div class="listingblock">
1869 <div class="content">
1870 <pre class="highlight"><code>constexpr void assign( int val, const error_category &amp; cat ) noexcept;</code></pre>
1871 </div>
1872 </div>
1873 <div class="ulist none">
1874 <ul class="none">
1875 <li>
1876 <p></p>
1877 <div class="dlist">
1878 <dl>
1879 <dt class="hdlist1">Ensures: </dt>
1880 <dd>
1881 <p><code>val_ == val</code>; <code>cat_ == &amp;cat</code>.</p>
1882 </dd>
1883 </dl>
1884 </div>
1885 </li>
1886 </ul>
1887 </div>
1888 <div class="listingblock">
1889 <div class="content">
1890 <pre class="highlight"><code>template &lt;class ErrorConditionEnum&gt;
1891   constexpr error_condition &amp; operator=( ErrorConditionEnum e ) noexcept;</code></pre>
1892 </div>
1893 </div>
1894 <div class="ulist none">
1895 <ul class="none">
1896 <li>
1897 <p></p>
1898 <div class="dlist">
1899 <dl>
1900 <dt class="hdlist1">Ensures: </dt>
1901 <dd>
1902 <p><code>*this == make_error_condition( e )</code>.</p>
1903 </dd>
1904 <dt class="hdlist1">Remarks: </dt>
1905 <dd>
1906 <p>This operator is only enabled when <code>is_error_condition_enum&lt;ErrorConditionEnum&gt;::value</code> is <code>true</code>.</p>
1907 </dd>
1908 </dl>
1909 </div>
1910 </li>
1911 </ul>
1912 </div>
1913 <div class="listingblock">
1914 <div class="content">
1915 <pre class="highlight"><code>constexpr void clear() noexcept;</code></pre>
1916 </div>
1917 </div>
1918 <div class="ulist none">
1919 <ul class="none">
1920 <li>
1921 <p></p>
1922 <div class="dlist">
1923 <dl>
1924 <dt class="hdlist1">Ensures: </dt>
1925 <dd>
1926 <p><code>val_ == 0</code>; <code>*cat_ == generic_category()</code>.</p>
1927 </dd>
1928 </dl>
1929 </div>
1930 </li>
1931 </ul>
1932 </div>
1933 </div>
1934 <div class="sect4">
1935 <h5 id="ref_observers_2">Observers</h5>
1936 <div class="listingblock">
1937 <div class="content">
1938 <pre class="highlight"><code>constexpr int value() const noexcept;</code></pre>
1939 </div>
1940 </div>
1941 <div class="ulist none">
1942 <ul class="none">
1943 <li>
1944 <p></p>
1945 <div class="dlist">
1946 <dl>
1947 <dt class="hdlist1">Returns: </dt>
1948 <dd>
1949 <p><code>val_</code>.</p>
1950 </dd>
1951 </dl>
1952 </div>
1953 </li>
1954 </ul>
1955 </div>
1956 <div class="listingblock">
1957 <div class="content">
1958 <pre class="highlight"><code>constexpr const error_category &amp; category() const noexcept;</code></pre>
1959 </div>
1960 </div>
1961 <div class="ulist none">
1962 <ul class="none">
1963 <li>
1964 <p></p>
1965 <div class="dlist">
1966 <dl>
1967 <dt class="hdlist1">Returns: </dt>
1968 <dd>
1969 <p><code>*cat_</code>.</p>
1970 </dd>
1971 </dl>
1972 </div>
1973 </li>
1974 </ul>
1975 </div>
1976 <div class="listingblock">
1977 <div class="content">
1978 <pre class="highlight"><code>std::string message() const;</code></pre>
1979 </div>
1980 </div>
1981 <div class="ulist none">
1982 <ul class="none">
1983 <li>
1984 <p></p>
1985 <div class="dlist">
1986 <dl>
1987 <dt class="hdlist1">Returns: </dt>
1988 <dd>
1989 <p><code>cat_-&gt;message( val_ )</code>.</p>
1990 </dd>
1991 </dl>
1992 </div>
1993 </li>
1994 </ul>
1995 </div>
1996 <div class="listingblock">
1997 <div class="content">
1998 <pre class="highlight"><code>char const * message( char * buffer, std::size_t len ) const noexcept;</code></pre>
1999 </div>
2000 </div>
2001 <div class="ulist none">
2002 <ul class="none">
2003 <li>
2004 <p></p>
2005 <div class="dlist">
2006 <dl>
2007 <dt class="hdlist1">Returns: </dt>
2008 <dd>
2009 <p><code>cat_-&gt;message( val_, buffer, len )</code>.</p>
2010 </dd>
2011 </dl>
2012 </div>
2013 </li>
2014 </ul>
2015 </div>
2016 <div class="listingblock">
2017 <div class="content">
2018 <pre class="highlight"><code>constexpr bool failed() const noexcept;</code></pre>
2019 </div>
2020 </div>
2021 <div class="ulist none">
2022 <ul class="none">
2023 <li>
2024 <p></p>
2025 <div class="dlist">
2026 <dl>
2027 <dt class="hdlist1">Returns: </dt>
2028 <dd>
2029 <p><code>cat_-&gt;failed( val_ )</code>.</p>
2030 </dd>
2031 </dl>
2032 </div>
2033 </li>
2034 </ul>
2035 </div>
2036 <div class="listingblock">
2037 <div class="content">
2038 <pre class="highlight"><code>constexpr explicit operator bool() const noexcept;</code></pre>
2039 </div>
2040 </div>
2041 <div class="ulist none">
2042 <ul class="none">
2043 <li>
2044 <p></p>
2045 <div class="dlist">
2046 <dl>
2047 <dt class="hdlist1">Returns: </dt>
2048 <dd>
2049 <p><code>val_ != 0</code>.</p>
2050 </dd>
2051 </dl>
2052 </div>
2053 </li>
2054 </ul>
2055 </div>
2056 <div class="listingblock">
2057 <div class="content">
2058 <pre class="highlight"><code>operator std::error_condition() const;</code></pre>
2059 </div>
2060 </div>
2061 <div class="ulist none">
2062 <ul class="none">
2063 <li>
2064 <p></p>
2065 <div class="dlist">
2066 <dl>
2067 <dt class="hdlist1">Returns: </dt>
2068 <dd>
2069 <p><code>std::error_condition( val_, *cat_ )</code>.</p>
2070 </dd>
2071 </dl>
2072 </div>
2073 </li>
2074 </ul>
2075 </div>
2076 </div>
2077 </div>
2078 <div class="sect3">
2079 <h4 id="ref_nonmember_functions">Nonmember functions</h4>
2080 <div class="listingblock">
2081 <div class="content">
2082 <pre class="highlight"><code>constexpr bool operator==( const error_code &amp; lhs,
2083   const error_code &amp; rhs ) noexcept;
2084 constexpr bool operator==( const error_condition &amp; lhs,
2085   const error_condition &amp; rhs ) noexcept;</code></pre>
2086 </div>
2087 </div>
2088 <div class="ulist none">
2089 <ul class="none">
2090 <li>
2091 <p></p>
2092 <div class="dlist">
2093 <dl>
2094 <dt class="hdlist1">Returns: </dt>
2095 <dd>
2096 <p><code>lhs.value() == rhs.value() &amp;&amp; lhs.category() == rhs.category()</code>.</p>
2097 </dd>
2098 </dl>
2099 </div>
2100 </li>
2101 </ul>
2102 </div>
2103 <div class="listingblock">
2104 <div class="content">
2105 <pre class="highlight"><code>bool operator==( const error_code &amp; code,
2106   const error_condition &amp; condition ) noexcept;
2107 bool operator==( const error_condition &amp; condition,
2108   const error_code &amp; code ) noexcept;</code></pre>
2109 </div>
2110 </div>
2111 <div class="ulist none">
2112 <ul class="none">
2113 <li>
2114 <p></p>
2115 <div class="dlist">
2116 <dl>
2117 <dt class="hdlist1">Returns: </dt>
2118 <dd>
2119 <p><code>code.category().equivalent( code.value(), condition ) || condition.category().equivalent( code, condition.value() )</code>.</p>
2120 </dd>
2121 </dl>
2122 </div>
2123 </li>
2124 </ul>
2125 </div>
2126 <div class="listingblock">
2127 <div class="content">
2128 <pre class="highlight"><code>constexpr bool operator!=( const error_code &amp; lhs,
2129   const error_code &amp; rhs ) noexcept;
2130 constexpr bool operator!=( const error_condition &amp; lhs,
2131   const error_condition &amp; rhs ) noexcept;
2132 bool operator!=( const error_code &amp; code,
2133   const error_condition &amp; condition ) noexcept;
2134 bool operator!=( const error_condition &amp; condition,
2135   const error_code &amp; code ) noexcept;</code></pre>
2136 </div>
2137 </div>
2138 <div class="ulist none">
2139 <ul class="none">
2140 <li>
2141 <p></p>
2142 <div class="dlist">
2143 <dl>
2144 <dt class="hdlist1">Returns: </dt>
2145 <dd>
2146 <p><code>!( lhs == rhs )</code>.</p>
2147 </dd>
2148 </dl>
2149 </div>
2150 </li>
2151 </ul>
2152 </div>
2153 <div class="listingblock">
2154 <div class="content">
2155 <pre class="highlight"><code>constexpr bool operator&lt;( const error_code &amp; lhs,
2156   const error_code &amp; rhs ) noexcept;
2157 constexpr bool operator&lt;( const error_condition &amp; lhs,
2158   const error_condition &amp; rhs ) noexcept;</code></pre>
2159 </div>
2160 </div>
2161 <div class="ulist none">
2162 <ul class="none">
2163 <li>
2164 <p></p>
2165 <div class="dlist">
2166 <dl>
2167 <dt class="hdlist1">Returns: </dt>
2168 <dd>
2169 <p><code>lhs.category() &lt; rhs.category() || ( lhs.category() == rhs.category() &amp;&amp; lhs.value() &lt; rhs.value() )</code>.</p>
2170 </dd>
2171 </dl>
2172 </div>
2173 </li>
2174 </ul>
2175 </div>
2176 <div class="listingblock">
2177 <div class="content">
2178 <pre class="highlight"><code>constexpr error_code make_error_code( errc::errc_t e ) noexcept;</code></pre>
2179 </div>
2180 </div>
2181 <div class="ulist none">
2182 <ul class="none">
2183 <li>
2184 <p></p>
2185 <div class="dlist">
2186 <dl>
2187 <dt class="hdlist1">Returns: </dt>
2188 <dd>
2189 <p><code>error_code( e, generic_category() )</code>.</p>
2190 </dd>
2191 </dl>
2192 </div>
2193 </li>
2194 </ul>
2195 </div>
2196 <div class="listingblock">
2197 <div class="content">
2198 <pre class="highlight"><code>constexpr error_condition make_error_condition( errc::errc_t e ) noexcept;</code></pre>
2199 </div>
2200 </div>
2201 <div class="ulist none">
2202 <ul class="none">
2203 <li>
2204 <p></p>
2205 <div class="dlist">
2206 <dl>
2207 <dt class="hdlist1">Returns: </dt>
2208 <dd>
2209 <p><code>error_condition( e, generic_category() )</code>.</p>
2210 </dd>
2211 </dl>
2212 </div>
2213 </li>
2214 </ul>
2215 </div>
2216 <div class="listingblock">
2217 <div class="content">
2218 <pre class="highlight"><code>template &lt;class charT, class traits&gt;
2219   std::basic_ostream&lt;charT, traits&gt;&amp;
2220     operator&lt;&lt;( basic_ostream&lt;charT, traits&gt;&amp; os, const error_code &amp; ec );</code></pre>
2221 </div>
2222 </div>
2223 <div class="ulist none">
2224 <ul class="none">
2225 <li>
2226 <p></p>
2227 <div class="dlist">
2228 <dl>
2229 <dt class="hdlist1">Effects: </dt>
2230 <dd>
2231 <p><code>os &lt;&lt; ec.category().name() &lt;&lt; ':' &lt;&lt; ec.value()</code>.</p>
2232 </dd>
2233 <dt class="hdlist1">Returns: </dt>
2234 <dd>
2235 <p><code>os</code>.</p>
2236 </dd>
2237 </dl>
2238 </div>
2239 </li>
2240 </ul>
2241 </div>
2242 <div class="listingblock">
2243 <div class="content">
2244 <pre class="highlight"><code>std::size_t hash_value( const error_code &amp; ec );</code></pre>
2245 </div>
2246 </div>
2247 <div class="ulist none">
2248 <ul class="none">
2249 <li>
2250 <p></p>
2251 <div class="dlist">
2252 <dl>
2253 <dt class="hdlist1">Returns: </dt>
2254 <dd>
2255 <p>A hash value representing <code>ec</code>.</p>
2256 </dd>
2257 </dl>
2258 </div>
2259 </li>
2260 </ul>
2261 </div>
2262 </div>
2263 </div>
2264 <div class="sect2">
2265 <h3 id="ref_boostsystemsystem_error_hpp">&lt;boost/system/system_error.hpp&gt;</h3>
2266 <div class="sect3">
2267 <h4 id="ref_class_system_error">Class system_error</h4>
2268 <div class="paragraph">
2269 <p>The class <code>system_error</code> describes an exception object used to
2270 report errors that have an associated <code>error_code</code>. Such errors
2271 typically originate from operating system or other low-level
2272 application program interfaces.</p>
2273 </div>
2274 <div class="listingblock">
2275 <div class="content">
2276 <pre class="highlight"><code>namespace boost
2277 {
2278   namespace system
2279   {
2280     class system_error: public std::runtime_error
2281     {
2282     public:
2283
2284       explicit system_error( error_code ec );
2285       system_error( error_code ec, const char * what_arg );
2286       system_error( error_code ec, const std::string &amp; what_arg );
2287
2288       system_error( int ev, const error_category &amp; ecat );
2289       system_error( int ev, const error_category &amp; ecat,
2290         const char * what_arg );
2291       system_error( int ev, const error_category &amp; ecat,
2292         const std::string &amp; what_arg );
2293
2294       error_code code() const noexcept;
2295       const char * what() const noexcept;
2296     };
2297   }
2298 }</code></pre>
2299 </div>
2300 </div>
2301 <div class="sect4">
2302 <h5 id="ref_constructors_4">Constructors</h5>
2303 <div class="listingblock">
2304 <div class="content">
2305 <pre class="highlight"><code>explicit system_error( error_code ec );
2306 system_error( error_code ec, const char * what_arg );
2307 system_error( error_code ec, const std::string &amp; what_arg );</code></pre>
2308 </div>
2309 </div>
2310 <div class="ulist none">
2311 <ul class="none">
2312 <li>
2313 <p></p>
2314 <div class="dlist">
2315 <dl>
2316 <dt class="hdlist1">Ensures: </dt>
2317 <dd>
2318 <p><code>code() == ec</code>.</p>
2319 </dd>
2320 </dl>
2321 </div>
2322 </li>
2323 </ul>
2324 </div>
2325 <div class="listingblock">
2326 <div class="content">
2327 <pre class="highlight"><code>system_error( int ev, const error_category &amp; ecat,
2328   const char * what_arg );
2329 system_error( int ev, const error_category &amp; ecat,
2330   const std::string &amp; what_arg );
2331 system_error( int ev, const error_category &amp; ecat );</code></pre>
2332 </div>
2333 </div>
2334 <div class="ulist none">
2335 <ul class="none">
2336 <li>
2337 <p></p>
2338 <div class="dlist">
2339 <dl>
2340 <dt class="hdlist1">Ensures: </dt>
2341 <dd>
2342 <p><code>code() == error_code( ev, ecat )</code>.</p>
2343 </dd>
2344 </dl>
2345 </div>
2346 </li>
2347 </ul>
2348 </div>
2349 </div>
2350 <div class="sect4">
2351 <h5 id="ref_observers_3">Observers</h5>
2352 <div class="listingblock">
2353 <div class="content">
2354 <pre class="highlight"><code>error_code code() const noexcept;</code></pre>
2355 </div>
2356 </div>
2357 <div class="ulist none">
2358 <ul class="none">
2359 <li>
2360 <p></p>
2361 <div class="dlist">
2362 <dl>
2363 <dt class="hdlist1">Returns: </dt>
2364 <dd>
2365 <p><code>ec</code> or <code>error_code( ev, ecat )</code>, from the constructor, as appropriate.</p>
2366 </dd>
2367 </dl>
2368 </div>
2369 </li>
2370 </ul>
2371 </div>
2372 <div class="listingblock">
2373 <div class="content">
2374 <pre class="highlight"><code>const char * what() const noexcept;</code></pre>
2375 </div>
2376 </div>
2377 <div class="ulist none">
2378 <ul class="none">
2379 <li>
2380 <p></p>
2381 <div class="dlist">
2382 <dl>
2383 <dt class="hdlist1">Returns: </dt>
2384 <dd>
2385 <p>A null-terminated character string incorporating the arguments supplied
2386 in the constructor, typically of the form <code>what_arg + ": " + code.message()</code>.</p>
2387 </dd>
2388 </dl>
2389 </div>
2390 </li>
2391 </ul>
2392 </div>
2393 </div>
2394 </div>
2395 </div>
2396 </div>
2397 </div>
2398 <div class="sect1">
2399 <h2 id="history">History</h2>
2400 <div class="sectionbody">
2401 <div class="paragraph">
2402 <p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1975.html">N1975</a>,
2403 Filesystem Library Proposal for TR2, accepted for Library Technical
2404 Report 2 (TR2) at the Berlin meeting, included additional components to
2405 supplement the Standard Library&#8217;s Diagnostics clause. Since then, these error
2406 reporting components have received wider public scrutiny and enhancements have
2407 been made to the design. The enhanced version has been used by
2408 <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2054.pdf">N2054</a>,
2409 Networking  Library Proposal for TR2, demonstrating that these error reporting
2410 components are useful beyond the original Filesystem Library.</p>
2411 </div>
2412 <div class="paragraph">
2413 <p>The original proposal viewed error categories as a binary choice between
2414 <code>errno</code> (i.e. POSIX-style) and the native operating system&#8217;s error
2415 codes. The proposed components now allow as many additional error categories as
2416 are needed by either implementations or by users. The need to support additional
2417 error categories, for example, occurs in some networking library implementations
2418 because they are built on top of the POSIX <code>getaddrinfo</code> API that
2419 uses error codes not based on <code>errno</code>.</p>
2420 </div>
2421 </div>
2422 </div>
2423 <div class="sect1">
2424 <h2 id="acknowledgments">Acknowledgments</h2>
2425 <div class="sectionbody">
2426 <div class="paragraph">
2427 <p>Christopher Kohlhoff and Peter Dimov made important contributions to the
2428 design. Comments and suggestions were also received from Pavel Vozenilek,
2429 Gennaro Prota, Dave Abrahams, Jeff Garland, Iain Hanson, Oliver Kowalke, and
2430 Oleg Abrosimov. Christopher Kohlhoff suggested several improvements to the
2431 <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2066.html">N2066</a>
2432 paper. Johan Nilsson&#8217;s comments led to several of the refinements in N2066.</p>
2433 </div>
2434 </div>
2435 </div>
2436 <div class="sect1">
2437 <h2 id="copyright">Copyright and License</h2>
2438 <div class="sectionbody">
2439 <div class="paragraph">
2440 <p>This documentation is</p>
2441 </div>
2442 <div class="ulist">
2443 <ul>
2444 <li>
2445 <p>Copyright 2003-2017 Beman Dawes</p>
2446 </li>
2447 <li>
2448 <p>Copyright 2018 Peter Dimov</p>
2449 </li>
2450 </ul>
2451 </div>
2452 <div class="paragraph">
2453 <p>and is distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</p>
2454 </div>
2455 </div>
2456 </div>
2457 </div>
2458 <div id="footer">
2459 <div id="footer-text">
2460 Last updated 2019-12-10 00:19:59 UTC
2461 </div>
2462 </div>
2463 <style>
2464
2465 *:not(pre)>code { background: none; color: #600000; }
2466
2467 </style>
2468 </body>
2469 </html>