system.html 85 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469
  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. class error_category;
  729. constexpr const error_category &amp; system_category() noexcept;
  730. constexpr const error_category &amp; generic_category() noexcept;
  731. class error_code;
  732. class error_condition;
  733. // "Concept" helpers
  734. template&lt;class T&gt;
  735. struct is_error_code_enum { static const bool value = false; };
  736. template&lt;class T&gt;
  737. struct is_error_condition_enum { static const bool value = false; };
  738. // generic error conditions
  739. namespace errc {
  740. enum errc_t
  741. {
  742. success = 0,
  743. address_family_not_supported, //EAFNOSUPPORT
  744. address_in_use, //EADDRINUSE
  745. address_not_available, //EADDRNOTAVAIL
  746. already_connected, //EISCONN
  747. argument_list_too_long, //E2BIG
  748. argument_out_of_domain, //EDOM
  749. bad_address, //EFAULT
  750. bad_file_descriptor, //EBADF
  751. bad_message, //EBADMSG
  752. broken_pipe, //EPIPE
  753. connection_aborted, //ECONNABORTED
  754. connection_already_in_progress, //EALREADY
  755. connection_refused, //ECONNREFUSED
  756. connection_reset, //ECONNRESET
  757. cross_device_link, //EXDEV
  758. destination_address_required, //EDESTADDRREQ
  759. device_or_resource_busy, //EBUSY
  760. directory_not_empty, //ENOTEMPTY
  761. executable_format_error, //ENOEXEC
  762. file_exists, //EEXIST
  763. file_too_large, //EFBIG
  764. filename_too_long, //ENAMETOOLONG
  765. function_not_supported, //ENOSYS
  766. host_unreachable, //EHOSTUNREACH
  767. identifier_removed, //EIDRM
  768. illegal_byte_sequence, //EILSEQ
  769. inappropriate_io_control_operation, //ENOTTY
  770. interrupted, //EINTR
  771. invalid_argument, //EINVAL
  772. invalid_seek, //ESPIPE
  773. io_error, //EIO
  774. is_a_directory, //EISDIR
  775. message_size, //EMSGSIZE
  776. network_down, //ENETDOWN
  777. network_reset, //ENETRESET
  778. network_unreachable, //ENETUNREACH
  779. no_buffer_space, //ENOBUFS
  780. no_child_process, //ECHILD
  781. no_link, //ENOLINK
  782. no_lock_available, //ENOLCK
  783. no_message_available, //ENODATA
  784. no_message, //ENOMSG
  785. no_protocol_option, //ENOPROTOOPT
  786. no_space_on_device, //ENOSPC
  787. no_stream_resources, //ENOSR
  788. no_such_device_or_address, //ENXIO
  789. no_such_device, //ENODEV
  790. no_such_file_or_directory, //ENOENT
  791. no_such_process, //ESRCH
  792. not_a_directory, //ENOTDIR
  793. not_a_socket, //ENOTSOCK
  794. not_a_stream, //ENOSTR
  795. not_connected, //ENOTCONN
  796. not_enough_memory, //ENOMEM
  797. not_supported, //ENOTSUP
  798. operation_canceled, //ECANCELED
  799. operation_in_progress, //EINPROGRESS
  800. operation_not_permitted, //EPERM
  801. operation_not_supported, //EOPNOTSUPP
  802. operation_would_block, //EWOULDBLOCK
  803. owner_dead, //EOWNERDEAD
  804. permission_denied, //EACCES
  805. protocol_error, //EPROTO
  806. protocol_not_supported, //EPROTONOSUPPORT
  807. read_only_file_system, //EROFS
  808. resource_deadlock_would_occur, //EDEADLK
  809. resource_unavailable_try_again, //EAGAIN
  810. result_out_of_range, //ERANGE
  811. state_not_recoverable, //ENOTRECOVERABLE
  812. stream_timeout, //ETIME
  813. text_file_busy, //ETXTBSY
  814. timed_out, //ETIMEDOUT
  815. too_many_files_open_in_system, //ENFILE
  816. too_many_files_open, //EMFILE
  817. too_many_links, //EMLINK
  818. too_many_synbolic_link_levels, //ELOOP
  819. value_too_large, //EOVERFLOW
  820. wrong_protocol_type //EPROTOTYPE
  821. };
  822. } // namespace errc
  823. template&lt;&gt; struct is_error_condition_enum&lt;errc::errc_t&gt;
  824. { static const bool value = true; };
  825. // non-member functions
  826. constexpr bool operator==( const error_code &amp; lhs,
  827. const error_code &amp; rhs ) noexcept;
  828. bool operator==( const error_code &amp; code,
  829. const error_condition &amp; condition ) noexcept;
  830. bool operator==( const error_condition &amp; condition,
  831. const error_code &amp; code ) noexcept;
  832. constexpr bool operator==( const error_condition &amp; lhs,
  833. const error_condition &amp; rhs ) noexcept;
  834. constexpr bool operator!=( const error_code &amp; lhs,
  835. const error_code &amp; rhs ) noexcept;
  836. bool operator!=( const error_code &amp; code,
  837. const error_condition &amp; condition ) noexcept;
  838. bool operator!=( const error_condition &amp; condition,
  839. const error_code &amp; code ) noexcept;
  840. constexpr bool operator!=( const error_condition &amp; lhs,
  841. const error_condition &amp; rhs ) noexcept;
  842. constexpr bool operator&lt;( const error_code &amp; lhs,
  843. const error_code &amp; rhs ) noexcept;
  844. constexpr bool operator&lt;( const error_condition &amp; lhs,
  845. const error_condition &amp; rhs ) noexcept;
  846. constexpr error_code make_error_code( errc::errc_t e ) noexcept;
  847. constexpr error_condition make_error_condition( errc::errc_t e ) noexcept;
  848. template &lt;class charT, class traits&gt;
  849. std::basic_ostream&lt;charT, traits&gt;&amp;
  850. operator&lt;&lt;( basic_ostream&lt;charT, traits&gt;&amp; os, const error_code &amp; ec );
  851. std::size_t hash_value( const error_code &amp; ec );
  852. } // namespace system
  853. } // namespace boost</code></pre>
  854. </div>
  855. </div>
  856. <div class="paragraph">
  857. <p>The value of each <code>errc_t</code> constant is the same as the value of the <code>&lt;cerrno&gt;</code>
  858. macro shown in the above synopsis.</p>
  859. </div>
  860. <div class="paragraph">
  861. <p>Users may specialize <code>is_error_code_enum</code> and <code>is_error_condition_enum</code>
  862. templates to indicate that a type is eligible for class <code>error_code</code> and
  863. <code>error_condition</code> automatic conversions respectively.</p>
  864. </div>
  865. </div>
  866. <div class="sect3">
  867. <h4 id="ref_class_error_category">Class error_category</h4>
  868. <div class="paragraph">
  869. <p>The class <code>error_category</code> defines the base class for types used
  870. to identify the source and encoding of a particular category of error code.</p>
  871. </div>
  872. <div class="paragraph">
  873. <p>Classes may be derived from <code>error_category</code> to support categories of
  874. errors in addition to those defined in Boost.System.</p>
  875. </div>
  876. <div class="listingblock">
  877. <div class="content">
  878. <pre class="highlight"><code>namespace boost {
  879. namespace system {
  880. class error_category
  881. {
  882. public: // noncopyable
  883. error_category( error_category const &amp; ) = delete;
  884. error_category&amp; operator=( error_category const &amp; ) = delete;
  885. protected:
  886. ~error_category() = default;
  887. constexpr error_category() noexcept;
  888. explicit constexpr error_category( unsigned long long id ) noexcept;
  889. public:
  890. virtual const char * name() const noexcept = 0;
  891. virtual error_condition default_error_condition( int ev ) const noexcept;
  892. virtual bool equivalent( int code, const error_condition &amp; condition )
  893. const noexcept;
  894. virtual bool equivalent( const error_code &amp; code, int condition )
  895. const noexcept;
  896. virtual std::string message( int ev ) const = 0;
  897. virtual char const * message( int ev, char * buffer, std::size_t len )
  898. const noexcept;
  899. virtual bool failed( int ev ) const noexcept;
  900. constexpr bool operator==( const error_category &amp; rhs ) const noexcept;
  901. constexpr bool operator!=( const error_category &amp; rhs ) const noexcept;
  902. constexpr bool operator&lt; ( const error_category &amp; rhs ) const noexcept;
  903. operator std::error_category const &amp; () const;
  904. private:
  905. unsigned long long id_; // exposition only
  906. };
  907. }
  908. }</code></pre>
  909. </div>
  910. </div>
  911. <div class="sect4">
  912. <h5 id="ref_constructors">Constructors</h5>
  913. <div class="listingblock">
  914. <div class="content">
  915. <pre class="highlight"><code>constexpr error_category() noexcept;</code></pre>
  916. </div>
  917. </div>
  918. <div class="ulist none">
  919. <ul class="none">
  920. <li>
  921. <p></p>
  922. <div class="dlist">
  923. <dl>
  924. <dt class="hdlist1">Effects: </dt>
  925. <dd>
  926. <p>Initializes <code>id_</code> to 0.</p>
  927. </dd>
  928. <dt class="hdlist1">Remarks: </dt>
  929. <dd>
  930. <p>Since equivalence for categories that do not have an identifier is
  931. based on comparing object addresses, a user-defined derived category of type
  932. <code>C</code> that uses this constructor should ensure that only one object of type <code>C</code>
  933. exists in the program.</p>
  934. </dd>
  935. </dl>
  936. </div>
  937. </li>
  938. </ul>
  939. </div>
  940. <div class="listingblock">
  941. <div class="content">
  942. <pre class="highlight"><code>explicit constexpr error_category( unsigned long long id ) noexcept;</code></pre>
  943. </div>
  944. </div>
  945. <div class="ulist none">
  946. <ul class="none">
  947. <li>
  948. <p></p>
  949. <div class="dlist">
  950. <dl>
  951. <dt class="hdlist1">Effects: </dt>
  952. <dd>
  953. <p>Initializes <code>id_</code> to <code>id</code>.</p>
  954. </dd>
  955. <dt class="hdlist1">Remarks: </dt>
  956. <dd>
  957. <p>User-defined derived categories that use this constructor are considered
  958. equivalent when their identifiers match. Therefore, those categories may have more
  959. than one instance existing in a program, but to minimize the possibility of
  960. collision, their identifiers must be randomly chosen (at the time the category
  961. is implemented, not at runtime). One way of generating a 64 bit random identifier
  962. 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>
  963. </dd>
  964. </dl>
  965. </div>
  966. </li>
  967. </ul>
  968. </div>
  969. </div>
  970. <div class="sect4">
  971. <h5 id="ref_virtuals">Virtuals</h5>
  972. <div class="listingblock">
  973. <div class="content">
  974. <pre class="highlight"><code>virtual const char * name() const noexcept = 0;</code></pre>
  975. </div>
  976. </div>
  977. <div class="ulist none">
  978. <ul class="none">
  979. <li>
  980. <p></p>
  981. <div class="dlist">
  982. <dl>
  983. <dt class="hdlist1">Returns: </dt>
  984. <dd>
  985. <p>In derived classes, a character literal naming the error category.</p>
  986. </dd>
  987. </dl>
  988. </div>
  989. </li>
  990. </ul>
  991. </div>
  992. <div class="listingblock">
  993. <div class="content">
  994. <pre class="highlight"><code>virtual error_condition default_error_condition( int ev ) const noexcept;</code></pre>
  995. </div>
  996. </div>
  997. <div class="ulist none">
  998. <ul class="none">
  999. <li>
  1000. <p></p>
  1001. <div class="dlist">
  1002. <dl>
  1003. <dt class="hdlist1">Returns: </dt>
  1004. <dd>
  1005. <div class="ulist">
  1006. <ul>
  1007. <li>
  1008. <p>In derived classes, an error condition corresponding to <code>ev</code>.
  1009. The returned error condition will typically come from the generic category.</p>
  1010. </li>
  1011. <li>
  1012. <p>In the default implementation, <code>error_condition( ev, *this )</code>.</p>
  1013. </li>
  1014. </ul>
  1015. </div>
  1016. </dd>
  1017. </dl>
  1018. </div>
  1019. </li>
  1020. </ul>
  1021. </div>
  1022. <div class="listingblock">
  1023. <div class="content">
  1024. <pre class="highlight"><code>virtual bool equivalent( int code, const error_condition &amp; condition )
  1025. const noexcept;</code></pre>
  1026. </div>
  1027. </div>
  1028. <div class="ulist none">
  1029. <ul class="none">
  1030. <li>
  1031. <p></p>
  1032. <div class="dlist">
  1033. <dl>
  1034. <dt class="hdlist1">Returns: </dt>
  1035. <dd>
  1036. <div class="ulist">
  1037. <ul>
  1038. <li>
  1039. <p>In derived classes, <code>true</code> when <code>error_code( code, *this )</code> is equivalent to <code>condition</code>.</p>
  1040. </li>
  1041. <li>
  1042. <p>In the default implementation, <code>default_error_condition( code ) == condition</code>.</p>
  1043. </li>
  1044. </ul>
  1045. </div>
  1046. </dd>
  1047. </dl>
  1048. </div>
  1049. </li>
  1050. </ul>
  1051. </div>
  1052. <div class="listingblock">
  1053. <div class="content">
  1054. <pre class="highlight"><code>virtual bool equivalent( const error_code &amp; code, int condition )
  1055. const noexcept;</code></pre>
  1056. </div>
  1057. </div>
  1058. <div class="ulist none">
  1059. <ul class="none">
  1060. <li>
  1061. <p></p>
  1062. <div class="dlist">
  1063. <dl>
  1064. <dt class="hdlist1">Returns: </dt>
  1065. <dd>
  1066. <div class="ulist">
  1067. <ul>
  1068. <li>
  1069. <p>In derived classes, <code>true</code> when <code>code</code> is equivalent to <code>error_condition( condition, *this )</code>.</p>
  1070. </li>
  1071. <li>
  1072. <p>In the default implementation, <code>*this == code.category() &amp;&amp; code.value() == condition</code>.</p>
  1073. </li>
  1074. </ul>
  1075. </div>
  1076. </dd>
  1077. </dl>
  1078. </div>
  1079. </li>
  1080. </ul>
  1081. </div>
  1082. <div class="listingblock">
  1083. <div class="content">
  1084. <pre class="highlight"><code>virtual std::string message( int ev ) const = 0;</code></pre>
  1085. </div>
  1086. </div>
  1087. <div class="ulist none">
  1088. <ul class="none">
  1089. <li>
  1090. <p></p>
  1091. <div class="dlist">
  1092. <dl>
  1093. <dt class="hdlist1">Returns: </dt>
  1094. <dd>
  1095. <p>In derived classes, a string that describes the error denoted by <code>ev</code>.</p>
  1096. </dd>
  1097. </dl>
  1098. </div>
  1099. </li>
  1100. </ul>
  1101. </div>
  1102. <div class="listingblock">
  1103. <div class="content">
  1104. <pre class="highlight"><code>virtual char const * message( int ev, char * buffer, std::size_t len )
  1105. const noexcept;</code></pre>
  1106. </div>
  1107. </div>
  1108. <div class="ulist none">
  1109. <ul class="none">
  1110. <li>
  1111. <p></p>
  1112. <div class="dlist">
  1113. <dl>
  1114. <dt class="hdlist1">Effects: </dt>
  1115. <dd>
  1116. <div class="ulist">
  1117. <ul>
  1118. <li>
  1119. <p>Derived classes should either</p>
  1120. <div class="ulist">
  1121. <ul>
  1122. <li>
  1123. <p>return a pointer to a character literal describing the error denoted by <code>ev</code>, or</p>
  1124. </li>
  1125. <li>
  1126. <p>copy a string describing the error into <code>buffer</code>, truncating it to <code>len-1</code>
  1127. characters and storing a null terminator, and return <code>buffer</code>. If <code>len</code> is 0,
  1128. nothing is copied, but the function still returns <code>buffer</code>. Note that
  1129. when <code>len</code> is 0, <code>buffer</code> may be <code>nullptr</code>.</p>
  1130. </li>
  1131. </ul>
  1132. </div>
  1133. </li>
  1134. <li>
  1135. <p>The default implementation calls <code>message(ev)</code> and copies the result into
  1136. <code>buffer</code>, truncating it to <code>len-1</code> characters and storing a null terminator.
  1137. If <code>len</code> is 0, copies nothing. Returns <code>buffer</code>. If <code>message(ev)</code> throws an
  1138. exception, the string <code>"Message text unavailable"</code> is used.</p>
  1139. </li>
  1140. </ul>
  1141. </div>
  1142. </dd>
  1143. <dt class="hdlist1">Example: </dt>
  1144. <dd>
  1145. <div class="listingblock">
  1146. <div class="content">
  1147. <pre class="highlight"><code>const char* my_category::message(int ev, char* buffer, size_t len) const noexcept
  1148. {
  1149. switch(ev)
  1150. {
  1151. case 0: return "no error";
  1152. case 1: return "voltage out of range";
  1153. case 2: return "impedance mismatch";
  1154. case 31:
  1155. case 32:
  1156. case 33:
  1157. std::snprintf(buffer, len, "component %d failure", ev-30);
  1158. return buffer;
  1159. default:
  1160. std::snprintf(buffer, len, "unknown error %d", ev);
  1161. return buffer;
  1162. }
  1163. }</code></pre>
  1164. </div>
  1165. </div>
  1166. </dd>
  1167. </dl>
  1168. </div>
  1169. </li>
  1170. </ul>
  1171. </div>
  1172. <div class="listingblock">
  1173. <div class="content">
  1174. <pre class="highlight"><code>virtual bool failed( int ev ) const noexcept;</code></pre>
  1175. </div>
  1176. </div>
  1177. <div class="ulist none">
  1178. <ul class="none">
  1179. <li>
  1180. <p></p>
  1181. <div class="dlist">
  1182. <dl>
  1183. <dt class="hdlist1">Returns: </dt>
  1184. <dd>
  1185. <div class="ulist">
  1186. <ul>
  1187. <li>
  1188. <p>In derived classes, <code>true</code> when <code>ev</code> represents a failure.</p>
  1189. </li>
  1190. <li>
  1191. <p>In the default implementation, <code>ev != 0</code>.</p>
  1192. </li>
  1193. </ul>
  1194. </div>
  1195. </dd>
  1196. <dt class="hdlist1">Remarks: </dt>
  1197. <dd>
  1198. <p>All calls to this function with the same <code>ev</code> must return the same value.</p>
  1199. </dd>
  1200. </dl>
  1201. </div>
  1202. </li>
  1203. </ul>
  1204. </div>
  1205. </div>
  1206. <div class="sect4">
  1207. <h5 id="ref_nonvirtuals">Nonvirtuals</h5>
  1208. <div class="listingblock">
  1209. <div class="content">
  1210. <pre class="highlight"><code>constexpr bool operator==( const error_category &amp; rhs ) const noexcept;</code></pre>
  1211. </div>
  1212. </div>
  1213. <div class="ulist none">
  1214. <ul class="none">
  1215. <li>
  1216. <p></p>
  1217. <div class="dlist">
  1218. <dl>
  1219. <dt class="hdlist1">Returns: </dt>
  1220. <dd>
  1221. <p><code>rhs.id_ == 0? this == &amp;rhs: id_ == rhs.id_</code>.</p>
  1222. </dd>
  1223. <dt class="hdlist1">Remarks: </dt>
  1224. <dd>
  1225. <p>Two category objects are considered equivalent when they have matching
  1226. nonzero identifiers, or are the same object.</p>
  1227. </dd>
  1228. </dl>
  1229. </div>
  1230. </li>
  1231. </ul>
  1232. </div>
  1233. <div class="listingblock">
  1234. <div class="content">
  1235. <pre class="highlight"><code>constexpr bool operator!=( const error_category &amp; rhs ) const noexcept;</code></pre>
  1236. </div>
  1237. </div>
  1238. <div class="ulist none">
  1239. <ul class="none">
  1240. <li>
  1241. <p></p>
  1242. <div class="dlist">
  1243. <dl>
  1244. <dt class="hdlist1">Returns: </dt>
  1245. <dd>
  1246. <p><code>!( *this == rhs )</code>.</p>
  1247. </dd>
  1248. </dl>
  1249. </div>
  1250. </li>
  1251. </ul>
  1252. </div>
  1253. <div class="listingblock">
  1254. <div class="content">
  1255. <pre class="highlight"><code>constexpr bool operator&lt; ( const error_category &amp; rhs ) const noexcept;</code></pre>
  1256. </div>
  1257. </div>
  1258. <div class="ulist none">
  1259. <ul class="none">
  1260. <li>
  1261. <p></p>
  1262. <div class="dlist">
  1263. <dl>
  1264. <dt class="hdlist1">Returns: </dt>
  1265. <dd>
  1266. <div class="ulist">
  1267. <ul>
  1268. <li>
  1269. <p>If <code>id_ &lt; rhs.id_</code>, <code>true</code>;</p>
  1270. </li>
  1271. <li>
  1272. <p>Otherwise, if <code>id_ &gt; rhs.id_</code>, <code>false</code>;</p>
  1273. </li>
  1274. <li>
  1275. <p>Otherwise, if <code>rhs.id_ != 0</code>, <code>false</code>;</p>
  1276. </li>
  1277. <li>
  1278. <p>Otherwise, <code>std::less&lt;error_category const *&gt;()( this, &amp;rhs )</code>.</p>
  1279. </li>
  1280. </ul>
  1281. </div>
  1282. </dd>
  1283. </dl>
  1284. </div>
  1285. </li>
  1286. </ul>
  1287. </div>
  1288. <div class="listingblock">
  1289. <div class="content">
  1290. <pre class="highlight"><code>operator std::error_category const &amp; () const;</code></pre>
  1291. </div>
  1292. </div>
  1293. <div class="ulist none">
  1294. <ul class="none">
  1295. <li>
  1296. <p></p>
  1297. <div class="dlist">
  1298. <dl>
  1299. <dt class="hdlist1">Returns: </dt>
  1300. <dd>
  1301. <p>A reference to an <code>std::error_category</code> object corresponding
  1302. to <code>*this</code>.</p>
  1303. </dd>
  1304. </dl>
  1305. </div>
  1306. </li>
  1307. </ul>
  1308. </div>
  1309. </div>
  1310. </div>
  1311. <div class="sect3">
  1312. <h4 id="ref_predefined_categories">Predefined Categories</h4>
  1313. <div class="listingblock">
  1314. <div class="content">
  1315. <pre class="highlight"><code>constexpr const error_category &amp; system_category() noexcept;</code></pre>
  1316. </div>
  1317. </div>
  1318. <div class="ulist none">
  1319. <ul class="none">
  1320. <li>
  1321. <p></p>
  1322. <div class="dlist">
  1323. <dl>
  1324. <dt class="hdlist1">Returns: </dt>
  1325. <dd>
  1326. <p>A reference to an <code>error_category</code> object identifying errors
  1327. originating from the operating system.</p>
  1328. </dd>
  1329. </dl>
  1330. </div>
  1331. </li>
  1332. </ul>
  1333. </div>
  1334. <div class="listingblock">
  1335. <div class="content">
  1336. <pre class="highlight"><code>constexpr const error_category &amp; generic_category() noexcept;</code></pre>
  1337. </div>
  1338. </div>
  1339. <div class="ulist none">
  1340. <ul class="none">
  1341. <li>
  1342. <p></p>
  1343. <div class="dlist">
  1344. <dl>
  1345. <dt class="hdlist1">Returns: </dt>
  1346. <dd>
  1347. <p>A reference to an <code>error_category</code> object identifying portable
  1348. error conditions.</p>
  1349. </dd>
  1350. </dl>
  1351. </div>
  1352. </li>
  1353. </ul>
  1354. </div>
  1355. </div>
  1356. <div class="sect3">
  1357. <h4 id="ref_class_error_code">Class error_code</h4>
  1358. <div class="paragraph">
  1359. <p>The class <code>error_code</code> describes an object used to hold error code
  1360. values, such as those originating from the operating system or other
  1361. low-level application program interfaces. It&#8217;s an adjunct to error reporting
  1362. by exception.</p>
  1363. </div>
  1364. <div class="listingblock">
  1365. <div class="content">
  1366. <pre class="highlight"><code>namespace boost {
  1367. namespace system {
  1368. class error_code {
  1369. public:
  1370. // constructors:
  1371. constexpr error_code() noexcept;
  1372. constexpr error_code( int val, const error_category &amp; cat ) noexcept;
  1373. template &lt;class ErrorCodeEnum&gt;
  1374. constexpr error_code( ErrorCodeEnum e ) noexcept;
  1375. // modifiers:
  1376. constexpr void assign( int val, const error_category &amp; cat ) noexcept;
  1377. template&lt;typename ErrorCodeEnum&gt;
  1378. constexpr error_code &amp; operator=( ErrorCodeEnum e ) noexcept;
  1379. constexpr void clear() noexcept;
  1380. // observers:
  1381. constexpr int value() const noexcept;
  1382. constexpr const error_category &amp; category() const noexcept;
  1383. error_condition default_error_condition() const noexcept;
  1384. std::string message() const;
  1385. char const * message( char * buffer, std::size_t len ) const noexcept;
  1386. constexpr bool failed() const noexcept;
  1387. constexpr explicit operator bool() const noexcept;
  1388. operator std::error_code() const;
  1389. private: // exposition only
  1390. int val_;
  1391. const error_category * cat_;
  1392. };
  1393. }
  1394. }</code></pre>
  1395. </div>
  1396. </div>
  1397. <div class="sect4">
  1398. <h5 id="ref_constructors_2">Constructors</h5>
  1399. <div class="listingblock">
  1400. <div class="content">
  1401. <pre class="highlight"><code>constexpr error_code() noexcept;</code></pre>
  1402. </div>
  1403. </div>
  1404. <div class="ulist none">
  1405. <ul class="none">
  1406. <li>
  1407. <p></p>
  1408. <div class="dlist">
  1409. <dl>
  1410. <dt class="hdlist1">Ensures: </dt>
  1411. <dd>
  1412. <p><code>val_ == 0</code>; <code>*cat_ == system_category()</code>.</p>
  1413. </dd>
  1414. </dl>
  1415. </div>
  1416. </li>
  1417. </ul>
  1418. </div>
  1419. <div class="listingblock">
  1420. <div class="content">
  1421. <pre class="highlight"><code>constexpr error_code( int val, const error_category &amp; cat ) noexcept;</code></pre>
  1422. </div>
  1423. </div>
  1424. <div class="ulist none">
  1425. <ul class="none">
  1426. <li>
  1427. <p></p>
  1428. <div class="dlist">
  1429. <dl>
  1430. <dt class="hdlist1">Ensures: </dt>
  1431. <dd>
  1432. <p><code>val_ == val</code>; <code>cat_ == &amp;cat</code>.</p>
  1433. </dd>
  1434. </dl>
  1435. </div>
  1436. </li>
  1437. </ul>
  1438. </div>
  1439. <div class="listingblock">
  1440. <div class="content">
  1441. <pre class="highlight"><code>template &lt;class ErrorCodeEnum&gt;
  1442. constexpr error_code( ErrorCodeEnum e ) noexcept;</code></pre>
  1443. </div>
  1444. </div>
  1445. <div class="ulist none">
  1446. <ul class="none">
  1447. <li>
  1448. <p></p>
  1449. <div class="dlist">
  1450. <dl>
  1451. <dt class="hdlist1">Ensures: </dt>
  1452. <dd>
  1453. <p><code>*this == make_error_code( e )</code>.</p>
  1454. </dd>
  1455. <dt class="hdlist1">Remarks: </dt>
  1456. <dd>
  1457. <p>This constructor is only enabled when <code>is_error_code_enum&lt;ErrorCodeEnum&gt;::value</code> is <code>true</code>.</p>
  1458. </dd>
  1459. </dl>
  1460. </div>
  1461. </li>
  1462. </ul>
  1463. </div>
  1464. </div>
  1465. <div class="sect4">
  1466. <h5 id="ref_modifiers">Modifiers</h5>
  1467. <div class="listingblock">
  1468. <div class="content">
  1469. <pre class="highlight"><code>constexpr void assign( int val, const error_category &amp; cat ) noexcept;</code></pre>
  1470. </div>
  1471. </div>
  1472. <div class="ulist none">
  1473. <ul class="none">
  1474. <li>
  1475. <p></p>
  1476. <div class="dlist">
  1477. <dl>
  1478. <dt class="hdlist1">Ensures: </dt>
  1479. <dd>
  1480. <p><code>val_ == val</code>; <code>cat_ == &amp;cat</code>.</p>
  1481. </dd>
  1482. </dl>
  1483. </div>
  1484. </li>
  1485. </ul>
  1486. </div>
  1487. <div class="listingblock">
  1488. <div class="content">
  1489. <pre class="highlight"><code>template&lt;typename ErrorCodeEnum&gt;
  1490. constexpr error_code &amp; operator=( ErrorCodeEnum e ) noexcept;</code></pre>
  1491. </div>
  1492. </div>
  1493. <div class="ulist none">
  1494. <ul class="none">
  1495. <li>
  1496. <p></p>
  1497. <div class="dlist">
  1498. <dl>
  1499. <dt class="hdlist1">Ensures: </dt>
  1500. <dd>
  1501. <p><code>*this == make_error_code( e )</code>.</p>
  1502. </dd>
  1503. <dt class="hdlist1">Remarks: </dt>
  1504. <dd>
  1505. <p>This operator is only enabled when <code>is_error_code_enum&lt;ErrorCodeEnum&gt;::value</code> is <code>true</code>.</p>
  1506. </dd>
  1507. </dl>
  1508. </div>
  1509. </li>
  1510. </ul>
  1511. </div>
  1512. <div class="listingblock">
  1513. <div class="content">
  1514. <pre class="highlight"><code>constexpr void clear() noexcept;</code></pre>
  1515. </div>
  1516. </div>
  1517. <div class="ulist none">
  1518. <ul class="none">
  1519. <li>
  1520. <p></p>
  1521. <div class="dlist">
  1522. <dl>
  1523. <dt class="hdlist1">Ensures: </dt>
  1524. <dd>
  1525. <p><code>val_ == 0</code>; <code>*cat_ == system_category()</code>.</p>
  1526. </dd>
  1527. </dl>
  1528. </div>
  1529. </li>
  1530. </ul>
  1531. </div>
  1532. </div>
  1533. <div class="sect4">
  1534. <h5 id="ref_observers">Observers</h5>
  1535. <div class="listingblock">
  1536. <div class="content">
  1537. <pre class="highlight"><code>constexpr int value() const noexcept;</code></pre>
  1538. </div>
  1539. </div>
  1540. <div class="ulist none">
  1541. <ul class="none">
  1542. <li>
  1543. <p></p>
  1544. <div class="dlist">
  1545. <dl>
  1546. <dt class="hdlist1">Returns: </dt>
  1547. <dd>
  1548. <p><code>val_</code>.</p>
  1549. </dd>
  1550. </dl>
  1551. </div>
  1552. </li>
  1553. </ul>
  1554. </div>
  1555. <div class="listingblock">
  1556. <div class="content">
  1557. <pre class="highlight"><code>constexpr const error_category &amp; category() const noexcept;</code></pre>
  1558. </div>
  1559. </div>
  1560. <div class="ulist none">
  1561. <ul class="none">
  1562. <li>
  1563. <p></p>
  1564. <div class="dlist">
  1565. <dl>
  1566. <dt class="hdlist1">Returns: </dt>
  1567. <dd>
  1568. <p><code>*cat_</code>.</p>
  1569. </dd>
  1570. </dl>
  1571. </div>
  1572. </li>
  1573. </ul>
  1574. </div>
  1575. <div class="listingblock">
  1576. <div class="content">
  1577. <pre class="highlight"><code>error_condition default_error_condition() const noexcept;</code></pre>
  1578. </div>
  1579. </div>
  1580. <div class="ulist none">
  1581. <ul class="none">
  1582. <li>
  1583. <p></p>
  1584. <div class="dlist">
  1585. <dl>
  1586. <dt class="hdlist1">Returns: </dt>
  1587. <dd>
  1588. <p><code>cat_-&gt;default_error_condition( val_ )</code>.</p>
  1589. </dd>
  1590. </dl>
  1591. </div>
  1592. </li>
  1593. </ul>
  1594. </div>
  1595. <div class="listingblock">
  1596. <div class="content">
  1597. <pre class="highlight"><code>std::string message() const;</code></pre>
  1598. </div>
  1599. </div>
  1600. <div class="ulist none">
  1601. <ul class="none">
  1602. <li>
  1603. <p></p>
  1604. <div class="dlist">
  1605. <dl>
  1606. <dt class="hdlist1">Returns: </dt>
  1607. <dd>
  1608. <p><code>cat_-&gt;message( val_ )</code>.</p>
  1609. </dd>
  1610. </dl>
  1611. </div>
  1612. </li>
  1613. </ul>
  1614. </div>
  1615. <div class="listingblock">
  1616. <div class="content">
  1617. <pre class="highlight"><code>char const * message( char * buffer, std::size_t len ) const noexcept;</code></pre>
  1618. </div>
  1619. </div>
  1620. <div class="ulist none">
  1621. <ul class="none">
  1622. <li>
  1623. <p></p>
  1624. <div class="dlist">
  1625. <dl>
  1626. <dt class="hdlist1">Returns: </dt>
  1627. <dd>
  1628. <p><code>cat_-&gt;message( val_, buffer, len )</code>.</p>
  1629. </dd>
  1630. </dl>
  1631. </div>
  1632. </li>
  1633. </ul>
  1634. </div>
  1635. <div class="listingblock">
  1636. <div class="content">
  1637. <pre class="highlight"><code>constexpr bool failed() const noexcept;</code></pre>
  1638. </div>
  1639. </div>
  1640. <div class="ulist none">
  1641. <ul class="none">
  1642. <li>
  1643. <p></p>
  1644. <div class="dlist">
  1645. <dl>
  1646. <dt class="hdlist1">Returns: </dt>
  1647. <dd>
  1648. <p><code>cat_-&gt;failed( val_ )</code>.</p>
  1649. </dd>
  1650. </dl>
  1651. </div>
  1652. </li>
  1653. </ul>
  1654. </div>
  1655. <div class="listingblock">
  1656. <div class="content">
  1657. <pre class="highlight"><code>constexpr explicit operator bool() const noexcept;</code></pre>
  1658. </div>
  1659. </div>
  1660. <div class="ulist none">
  1661. <ul class="none">
  1662. <li>
  1663. <p></p>
  1664. <div class="dlist">
  1665. <dl>
  1666. <dt class="hdlist1">Returns: </dt>
  1667. <dd>
  1668. <p><code>val_ != 0</code>.</p>
  1669. </dd>
  1670. </dl>
  1671. </div>
  1672. </li>
  1673. </ul>
  1674. </div>
  1675. <div class="listingblock">
  1676. <div class="content">
  1677. <pre class="highlight"><code>operator std::error_code() const;</code></pre>
  1678. </div>
  1679. </div>
  1680. <div class="ulist none">
  1681. <ul class="none">
  1682. <li>
  1683. <p></p>
  1684. <div class="dlist">
  1685. <dl>
  1686. <dt class="hdlist1">Returns: </dt>
  1687. <dd>
  1688. <p><code>std::error_code( val_, *cat_ )</code>.</p>
  1689. </dd>
  1690. </dl>
  1691. </div>
  1692. </li>
  1693. </ul>
  1694. </div>
  1695. </div>
  1696. </div>
  1697. <div class="sect3">
  1698. <h4 id="ref_class_error_condition">Class error_condition</h4>
  1699. <div class="listingblock">
  1700. <div class="content">
  1701. <pre class="highlight"><code>namespace boost {
  1702. namespace system {
  1703. class error_condition {
  1704. public:
  1705. // constructors:
  1706. constexpr error_condition() noexcept;
  1707. constexpr error_condition( int val, const error_category &amp; cat ) noexcept;
  1708. template &lt;class ErrorConditionEnum&gt;
  1709. constexpr error_condition( ErrorConditionEnum e ) noexcept;
  1710. // modifiers:
  1711. constexpr void assign( int val, const error_category &amp; cat ) noexcept;
  1712. template&lt;typename ErrorConditionEnum&gt;
  1713. constexpr error_condition &amp; operator=( ErrorConditionEnum e ) noexcept;
  1714. constexpr void clear() noexcept;
  1715. // observers:
  1716. constexpr int value() const noexcept;
  1717. constexpr const error_category &amp; category() const noexcept;
  1718. std::string message() const;
  1719. char const * message( char * buffer, std::size_t len ) const noexcept;
  1720. constexpr bool failed() const noexcept;
  1721. constexpr explicit operator bool() const noexcept;
  1722. operator std::error_condition() const;
  1723. private: // exposition only
  1724. int val_;
  1725. const error_category * cat_;
  1726. };
  1727. }
  1728. }</code></pre>
  1729. </div>
  1730. </div>
  1731. <div class="sect4">
  1732. <h5 id="ref_constructors_3">Constructors</h5>
  1733. <div class="listingblock">
  1734. <div class="content">
  1735. <pre class="highlight"><code>constexpr error_condition() noexcept;</code></pre>
  1736. </div>
  1737. </div>
  1738. <div class="ulist none">
  1739. <ul class="none">
  1740. <li>
  1741. <p></p>
  1742. <div class="dlist">
  1743. <dl>
  1744. <dt class="hdlist1">Ensures: </dt>
  1745. <dd>
  1746. <p><code>val_ == 0</code>; <code>*cat_ == generic_category()</code>.</p>
  1747. </dd>
  1748. </dl>
  1749. </div>
  1750. </li>
  1751. </ul>
  1752. </div>
  1753. <div class="listingblock">
  1754. <div class="content">
  1755. <pre class="highlight"><code>constexpr error_condition( int val, const error_category &amp; cat ) noexcept;</code></pre>
  1756. </div>
  1757. </div>
  1758. <div class="ulist none">
  1759. <ul class="none">
  1760. <li>
  1761. <p></p>
  1762. <div class="dlist">
  1763. <dl>
  1764. <dt class="hdlist1">Ensures: </dt>
  1765. <dd>
  1766. <p><code>val_ == val</code>; <code>cat_ == &amp;cat</code>.</p>
  1767. </dd>
  1768. </dl>
  1769. </div>
  1770. </li>
  1771. </ul>
  1772. </div>
  1773. <div class="listingblock">
  1774. <div class="content">
  1775. <pre class="highlight"><code>template &lt;class ErrorConditionEnum&gt;
  1776. constexpr error_condition( ErrorConditionEnum e ) noexcept;</code></pre>
  1777. </div>
  1778. </div>
  1779. <div class="ulist none">
  1780. <ul class="none">
  1781. <li>
  1782. <p></p>
  1783. <div class="dlist">
  1784. <dl>
  1785. <dt class="hdlist1">Ensures: </dt>
  1786. <dd>
  1787. <p><code>*this == make_error_condition( e )</code>.</p>
  1788. </dd>
  1789. <dt class="hdlist1">Remarks: </dt>
  1790. <dd>
  1791. <p>This constructor is only enabled when <code>is_error_condition_enum&lt;ErrorConditionEnum&gt;::value</code> is <code>true</code>.</p>
  1792. </dd>
  1793. </dl>
  1794. </div>
  1795. </li>
  1796. </ul>
  1797. </div>
  1798. </div>
  1799. <div class="sect4">
  1800. <h5 id="ref_modifiers_2">Modifiers</h5>
  1801. <div class="listingblock">
  1802. <div class="content">
  1803. <pre class="highlight"><code>constexpr void assign( int val, const error_category &amp; cat ) noexcept;</code></pre>
  1804. </div>
  1805. </div>
  1806. <div class="ulist none">
  1807. <ul class="none">
  1808. <li>
  1809. <p></p>
  1810. <div class="dlist">
  1811. <dl>
  1812. <dt class="hdlist1">Ensures: </dt>
  1813. <dd>
  1814. <p><code>val_ == val</code>; <code>cat_ == &amp;cat</code>.</p>
  1815. </dd>
  1816. </dl>
  1817. </div>
  1818. </li>
  1819. </ul>
  1820. </div>
  1821. <div class="listingblock">
  1822. <div class="content">
  1823. <pre class="highlight"><code>template &lt;class ErrorConditionEnum&gt;
  1824. constexpr error_condition &amp; operator=( ErrorConditionEnum e ) noexcept;</code></pre>
  1825. </div>
  1826. </div>
  1827. <div class="ulist none">
  1828. <ul class="none">
  1829. <li>
  1830. <p></p>
  1831. <div class="dlist">
  1832. <dl>
  1833. <dt class="hdlist1">Ensures: </dt>
  1834. <dd>
  1835. <p><code>*this == make_error_condition( e )</code>.</p>
  1836. </dd>
  1837. <dt class="hdlist1">Remarks: </dt>
  1838. <dd>
  1839. <p>This operator is only enabled when <code>is_error_condition_enum&lt;ErrorConditionEnum&gt;::value</code> is <code>true</code>.</p>
  1840. </dd>
  1841. </dl>
  1842. </div>
  1843. </li>
  1844. </ul>
  1845. </div>
  1846. <div class="listingblock">
  1847. <div class="content">
  1848. <pre class="highlight"><code>constexpr void clear() noexcept;</code></pre>
  1849. </div>
  1850. </div>
  1851. <div class="ulist none">
  1852. <ul class="none">
  1853. <li>
  1854. <p></p>
  1855. <div class="dlist">
  1856. <dl>
  1857. <dt class="hdlist1">Ensures: </dt>
  1858. <dd>
  1859. <p><code>val_ == 0</code>; <code>*cat_ == generic_category()</code>.</p>
  1860. </dd>
  1861. </dl>
  1862. </div>
  1863. </li>
  1864. </ul>
  1865. </div>
  1866. </div>
  1867. <div class="sect4">
  1868. <h5 id="ref_observers_2">Observers</h5>
  1869. <div class="listingblock">
  1870. <div class="content">
  1871. <pre class="highlight"><code>constexpr int value() const noexcept;</code></pre>
  1872. </div>
  1873. </div>
  1874. <div class="ulist none">
  1875. <ul class="none">
  1876. <li>
  1877. <p></p>
  1878. <div class="dlist">
  1879. <dl>
  1880. <dt class="hdlist1">Returns: </dt>
  1881. <dd>
  1882. <p><code>val_</code>.</p>
  1883. </dd>
  1884. </dl>
  1885. </div>
  1886. </li>
  1887. </ul>
  1888. </div>
  1889. <div class="listingblock">
  1890. <div class="content">
  1891. <pre class="highlight"><code>constexpr const error_category &amp; category() const 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">Returns: </dt>
  1901. <dd>
  1902. <p><code>*cat_</code>.</p>
  1903. </dd>
  1904. </dl>
  1905. </div>
  1906. </li>
  1907. </ul>
  1908. </div>
  1909. <div class="listingblock">
  1910. <div class="content">
  1911. <pre class="highlight"><code>std::string message() const;</code></pre>
  1912. </div>
  1913. </div>
  1914. <div class="ulist none">
  1915. <ul class="none">
  1916. <li>
  1917. <p></p>
  1918. <div class="dlist">
  1919. <dl>
  1920. <dt class="hdlist1">Returns: </dt>
  1921. <dd>
  1922. <p><code>cat_-&gt;message( val_ )</code>.</p>
  1923. </dd>
  1924. </dl>
  1925. </div>
  1926. </li>
  1927. </ul>
  1928. </div>
  1929. <div class="listingblock">
  1930. <div class="content">
  1931. <pre class="highlight"><code>char const * message( char * buffer, std::size_t len ) const noexcept;</code></pre>
  1932. </div>
  1933. </div>
  1934. <div class="ulist none">
  1935. <ul class="none">
  1936. <li>
  1937. <p></p>
  1938. <div class="dlist">
  1939. <dl>
  1940. <dt class="hdlist1">Returns: </dt>
  1941. <dd>
  1942. <p><code>cat_-&gt;message( val_, buffer, len )</code>.</p>
  1943. </dd>
  1944. </dl>
  1945. </div>
  1946. </li>
  1947. </ul>
  1948. </div>
  1949. <div class="listingblock">
  1950. <div class="content">
  1951. <pre class="highlight"><code>constexpr bool failed() const noexcept;</code></pre>
  1952. </div>
  1953. </div>
  1954. <div class="ulist none">
  1955. <ul class="none">
  1956. <li>
  1957. <p></p>
  1958. <div class="dlist">
  1959. <dl>
  1960. <dt class="hdlist1">Returns: </dt>
  1961. <dd>
  1962. <p><code>cat_-&gt;failed( val_ )</code>.</p>
  1963. </dd>
  1964. </dl>
  1965. </div>
  1966. </li>
  1967. </ul>
  1968. </div>
  1969. <div class="listingblock">
  1970. <div class="content">
  1971. <pre class="highlight"><code>constexpr explicit operator bool() const noexcept;</code></pre>
  1972. </div>
  1973. </div>
  1974. <div class="ulist none">
  1975. <ul class="none">
  1976. <li>
  1977. <p></p>
  1978. <div class="dlist">
  1979. <dl>
  1980. <dt class="hdlist1">Returns: </dt>
  1981. <dd>
  1982. <p><code>val_ != 0</code>.</p>
  1983. </dd>
  1984. </dl>
  1985. </div>
  1986. </li>
  1987. </ul>
  1988. </div>
  1989. <div class="listingblock">
  1990. <div class="content">
  1991. <pre class="highlight"><code>operator std::error_condition() const;</code></pre>
  1992. </div>
  1993. </div>
  1994. <div class="ulist none">
  1995. <ul class="none">
  1996. <li>
  1997. <p></p>
  1998. <div class="dlist">
  1999. <dl>
  2000. <dt class="hdlist1">Returns: </dt>
  2001. <dd>
  2002. <p><code>std::error_condition( val_, *cat_ )</code>.</p>
  2003. </dd>
  2004. </dl>
  2005. </div>
  2006. </li>
  2007. </ul>
  2008. </div>
  2009. </div>
  2010. </div>
  2011. <div class="sect3">
  2012. <h4 id="ref_nonmember_functions">Nonmember functions</h4>
  2013. <div class="listingblock">
  2014. <div class="content">
  2015. <pre class="highlight"><code>constexpr bool operator==( const error_code &amp; lhs,
  2016. const error_code &amp; rhs ) noexcept;
  2017. constexpr bool operator==( const error_condition &amp; lhs,
  2018. const error_condition &amp; rhs ) 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>lhs.value() == rhs.value() &amp;&amp; lhs.category() == rhs.category()</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>bool operator==( const error_code &amp; code,
  2039. const error_condition &amp; condition ) noexcept;
  2040. bool operator==( const error_condition &amp; condition,
  2041. const error_code &amp; code ) noexcept;</code></pre>
  2042. </div>
  2043. </div>
  2044. <div class="ulist none">
  2045. <ul class="none">
  2046. <li>
  2047. <p></p>
  2048. <div class="dlist">
  2049. <dl>
  2050. <dt class="hdlist1">Returns: </dt>
  2051. <dd>
  2052. <p><code>code.category().equivalent( code.value(), condition ) || condition.category().equivalent( code, condition.value() )</code>.</p>
  2053. </dd>
  2054. </dl>
  2055. </div>
  2056. </li>
  2057. </ul>
  2058. </div>
  2059. <div class="listingblock">
  2060. <div class="content">
  2061. <pre class="highlight"><code>constexpr bool operator!=( const error_code &amp; lhs,
  2062. const error_code &amp; rhs ) noexcept;
  2063. constexpr bool operator!=( const error_condition &amp; lhs,
  2064. const error_condition &amp; rhs ) noexcept;
  2065. bool operator!=( const error_code &amp; code,
  2066. const error_condition &amp; condition ) noexcept;
  2067. bool operator!=( const error_condition &amp; condition,
  2068. const error_code &amp; code ) noexcept;</code></pre>
  2069. </div>
  2070. </div>
  2071. <div class="ulist none">
  2072. <ul class="none">
  2073. <li>
  2074. <p></p>
  2075. <div class="dlist">
  2076. <dl>
  2077. <dt class="hdlist1">Returns: </dt>
  2078. <dd>
  2079. <p><code>!( lhs == rhs )</code>.</p>
  2080. </dd>
  2081. </dl>
  2082. </div>
  2083. </li>
  2084. </ul>
  2085. </div>
  2086. <div class="listingblock">
  2087. <div class="content">
  2088. <pre class="highlight"><code>constexpr bool operator&lt;( const error_code &amp; lhs,
  2089. const error_code &amp; rhs ) noexcept;
  2090. constexpr bool operator&lt;( const error_condition &amp; lhs,
  2091. const error_condition &amp; rhs ) noexcept;</code></pre>
  2092. </div>
  2093. </div>
  2094. <div class="ulist none">
  2095. <ul class="none">
  2096. <li>
  2097. <p></p>
  2098. <div class="dlist">
  2099. <dl>
  2100. <dt class="hdlist1">Returns: </dt>
  2101. <dd>
  2102. <p><code>lhs.category() &lt; rhs.category() || ( lhs.category() == rhs.category() &amp;&amp; lhs.value() &lt; rhs.value() )</code>.</p>
  2103. </dd>
  2104. </dl>
  2105. </div>
  2106. </li>
  2107. </ul>
  2108. </div>
  2109. <div class="listingblock">
  2110. <div class="content">
  2111. <pre class="highlight"><code>constexpr error_code make_error_code( errc::errc_t e ) noexcept;</code></pre>
  2112. </div>
  2113. </div>
  2114. <div class="ulist none">
  2115. <ul class="none">
  2116. <li>
  2117. <p></p>
  2118. <div class="dlist">
  2119. <dl>
  2120. <dt class="hdlist1">Returns: </dt>
  2121. <dd>
  2122. <p><code>error_code( e, generic_category() )</code>.</p>
  2123. </dd>
  2124. </dl>
  2125. </div>
  2126. </li>
  2127. </ul>
  2128. </div>
  2129. <div class="listingblock">
  2130. <div class="content">
  2131. <pre class="highlight"><code>constexpr error_condition make_error_condition( errc::errc_t e ) noexcept;</code></pre>
  2132. </div>
  2133. </div>
  2134. <div class="ulist none">
  2135. <ul class="none">
  2136. <li>
  2137. <p></p>
  2138. <div class="dlist">
  2139. <dl>
  2140. <dt class="hdlist1">Returns: </dt>
  2141. <dd>
  2142. <p><code>error_condition( e, generic_category() )</code>.</p>
  2143. </dd>
  2144. </dl>
  2145. </div>
  2146. </li>
  2147. </ul>
  2148. </div>
  2149. <div class="listingblock">
  2150. <div class="content">
  2151. <pre class="highlight"><code>template &lt;class charT, class traits&gt;
  2152. std::basic_ostream&lt;charT, traits&gt;&amp;
  2153. operator&lt;&lt;( basic_ostream&lt;charT, traits&gt;&amp; os, const error_code &amp; ec );</code></pre>
  2154. </div>
  2155. </div>
  2156. <div class="ulist none">
  2157. <ul class="none">
  2158. <li>
  2159. <p></p>
  2160. <div class="dlist">
  2161. <dl>
  2162. <dt class="hdlist1">Effects: </dt>
  2163. <dd>
  2164. <p><code>os &lt;&lt; ec.category().name() &lt;&lt; ':' &lt;&lt; ec.value()</code>.</p>
  2165. </dd>
  2166. <dt class="hdlist1">Returns: </dt>
  2167. <dd>
  2168. <p><code>os</code>.</p>
  2169. </dd>
  2170. </dl>
  2171. </div>
  2172. </li>
  2173. </ul>
  2174. </div>
  2175. <div class="listingblock">
  2176. <div class="content">
  2177. <pre class="highlight"><code>std::size_t hash_value( const error_code &amp; ec );</code></pre>
  2178. </div>
  2179. </div>
  2180. <div class="ulist none">
  2181. <ul class="none">
  2182. <li>
  2183. <p></p>
  2184. <div class="dlist">
  2185. <dl>
  2186. <dt class="hdlist1">Returns: </dt>
  2187. <dd>
  2188. <p>A hash value representing <code>ec</code>.</p>
  2189. </dd>
  2190. </dl>
  2191. </div>
  2192. </li>
  2193. </ul>
  2194. </div>
  2195. </div>
  2196. </div>
  2197. <div class="sect2">
  2198. <h3 id="ref_boostsystemsystem_error_hpp">&lt;boost/system/system_error.hpp&gt;</h3>
  2199. <div class="sect3">
  2200. <h4 id="ref_class_system_error">Class system_error</h4>
  2201. <div class="paragraph">
  2202. <p>The class <code>system_error</code> describes an exception object used to
  2203. report errors that have an associated <code>error_code</code>. Such errors
  2204. typically originate from operating system or other low-level
  2205. application program interfaces.</p>
  2206. </div>
  2207. <div class="listingblock">
  2208. <div class="content">
  2209. <pre class="highlight"><code>namespace boost
  2210. {
  2211. namespace system
  2212. {
  2213. class system_error: public std::runtime_error
  2214. {
  2215. public:
  2216. explicit system_error( error_code ec );
  2217. system_error( error_code ec, const char * what_arg );
  2218. system_error( error_code ec, const std::string &amp; what_arg );
  2219. system_error( int ev, const error_category &amp; ecat );
  2220. system_error( int ev, const error_category &amp; ecat,
  2221. const char * what_arg );
  2222. system_error( int ev, const error_category &amp; ecat,
  2223. const std::string &amp; what_arg );
  2224. error_code code() const noexcept;
  2225. const char * what() const noexcept;
  2226. };
  2227. }
  2228. }</code></pre>
  2229. </div>
  2230. </div>
  2231. <div class="sect4">
  2232. <h5 id="ref_constructors_4">Constructors</h5>
  2233. <div class="listingblock">
  2234. <div class="content">
  2235. <pre class="highlight"><code>explicit system_error( error_code ec );
  2236. system_error( error_code ec, const char * what_arg );
  2237. system_error( error_code ec, const std::string &amp; what_arg );</code></pre>
  2238. </div>
  2239. </div>
  2240. <div class="ulist none">
  2241. <ul class="none">
  2242. <li>
  2243. <p></p>
  2244. <div class="dlist">
  2245. <dl>
  2246. <dt class="hdlist1">Ensures: </dt>
  2247. <dd>
  2248. <p><code>code() == ec</code>.</p>
  2249. </dd>
  2250. </dl>
  2251. </div>
  2252. </li>
  2253. </ul>
  2254. </div>
  2255. <div class="listingblock">
  2256. <div class="content">
  2257. <pre class="highlight"><code>system_error( int ev, const error_category &amp; ecat,
  2258. const char * what_arg );
  2259. system_error( int ev, const error_category &amp; ecat,
  2260. const std::string &amp; what_arg );
  2261. system_error( int ev, const error_category &amp; ecat );</code></pre>
  2262. </div>
  2263. </div>
  2264. <div class="ulist none">
  2265. <ul class="none">
  2266. <li>
  2267. <p></p>
  2268. <div class="dlist">
  2269. <dl>
  2270. <dt class="hdlist1">Ensures: </dt>
  2271. <dd>
  2272. <p><code>code() == error_code( ev, ecat )</code>.</p>
  2273. </dd>
  2274. </dl>
  2275. </div>
  2276. </li>
  2277. </ul>
  2278. </div>
  2279. </div>
  2280. <div class="sect4">
  2281. <h5 id="ref_observers_3">Observers</h5>
  2282. <div class="listingblock">
  2283. <div class="content">
  2284. <pre class="highlight"><code>error_code code() const noexcept;</code></pre>
  2285. </div>
  2286. </div>
  2287. <div class="ulist none">
  2288. <ul class="none">
  2289. <li>
  2290. <p></p>
  2291. <div class="dlist">
  2292. <dl>
  2293. <dt class="hdlist1">Returns: </dt>
  2294. <dd>
  2295. <p><code>ec</code> or <code>error_code( ev, ecat )</code>, from the constructor, as appropriate.</p>
  2296. </dd>
  2297. </dl>
  2298. </div>
  2299. </li>
  2300. </ul>
  2301. </div>
  2302. <div class="listingblock">
  2303. <div class="content">
  2304. <pre class="highlight"><code>const char * what() const noexcept;</code></pre>
  2305. </div>
  2306. </div>
  2307. <div class="ulist none">
  2308. <ul class="none">
  2309. <li>
  2310. <p></p>
  2311. <div class="dlist">
  2312. <dl>
  2313. <dt class="hdlist1">Returns: </dt>
  2314. <dd>
  2315. <p>A null-terminated character string incorporating the arguments supplied
  2316. in the constructor, typically of the form <code>what_arg + ": " + code.message()</code>.</p>
  2317. </dd>
  2318. </dl>
  2319. </div>
  2320. </li>
  2321. </ul>
  2322. </div>
  2323. </div>
  2324. </div>
  2325. </div>
  2326. </div>
  2327. </div>
  2328. <div class="sect1">
  2329. <h2 id="history">History</h2>
  2330. <div class="sectionbody">
  2331. <div class="paragraph">
  2332. <p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1975.html">N1975</a>,
  2333. Filesystem Library Proposal for TR2, accepted for Library Technical
  2334. Report 2 (TR2) at the Berlin meeting, included additional components to
  2335. supplement the Standard Library&#8217;s Diagnostics clause. Since then, these error
  2336. reporting components have received wider public scrutiny and enhancements have
  2337. been made to the design. The enhanced version has been used by
  2338. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2054.pdf">N2054</a>,
  2339. Networking Library Proposal for TR2, demonstrating that these error reporting
  2340. components are useful beyond the original Filesystem Library.</p>
  2341. </div>
  2342. <div class="paragraph">
  2343. <p>The original proposal viewed error categories as a binary choice between
  2344. <code>errno</code> (i.e. POSIX-style) and the native operating system&#8217;s error
  2345. codes. The proposed components now allow as many additional error categories as
  2346. are needed by either implementations or by users. The need to support additional
  2347. error categories, for example, occurs in some networking library implementations
  2348. because they are built on top of the POSIX <code>getaddrinfo</code> API that
  2349. uses error codes not based on <code>errno</code>.</p>
  2350. </div>
  2351. </div>
  2352. </div>
  2353. <div class="sect1">
  2354. <h2 id="acknowledgments">Acknowledgments</h2>
  2355. <div class="sectionbody">
  2356. <div class="paragraph">
  2357. <p>Christopher Kohlhoff and Peter Dimov made important contributions to the
  2358. design. Comments and suggestions were also received from Pavel Vozenilek,
  2359. Gennaro Prota, Dave Abrahams, Jeff Garland, Iain Hanson, Oliver Kowalke, and
  2360. Oleg Abrosimov. Christopher Kohlhoff suggested several improvements to the
  2361. <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2066.html">N2066</a>
  2362. paper. Johan Nilsson&#8217;s comments led to several of the refinements in N2066.</p>
  2363. </div>
  2364. </div>
  2365. </div>
  2366. <div class="sect1">
  2367. <h2 id="copyright">Copyright and License</h2>
  2368. <div class="sectionbody">
  2369. <div class="paragraph">
  2370. <p>This documentation is</p>
  2371. </div>
  2372. <div class="ulist">
  2373. <ul>
  2374. <li>
  2375. <p>Copyright 2003-2017 Beman Dawes</p>
  2376. </li>
  2377. <li>
  2378. <p>Copyright 2018 Peter Dimov</p>
  2379. </li>
  2380. </ul>
  2381. </div>
  2382. <div class="paragraph">
  2383. <p>and is distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</p>
  2384. </div>
  2385. </div>
  2386. </div>
  2387. </div>
  2388. <div id="footer">
  2389. <div id="footer-text">
  2390. Last updated 2019-12-10 00:19:59 UTC
  2391. </div>
  2392. </div>
  2393. <style>
  2394. *:not(pre)>code { background: none; color: #600000; }
  2395. </style>
  2396. </body>
  2397. </html>