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="Peter Dimov"> 9<title>Boost.Assert</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";*/ 15article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block} 16audio,canvas,video{display:inline-block} 17audio:not([controls]){display:none;height:0} 18script{display:none!important} 19html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%} 20a{background:transparent} 21a:focus{outline:thin dotted} 22a:active,a:hover{outline:0} 23h1{font-size:2em;margin:.67em 0} 24abbr[title]{border-bottom:1px dotted} 25b,strong{font-weight:bold} 26dfn{font-style:italic} 27hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0} 28mark{background:#ff0;color:#000} 29code,kbd,pre,samp{font-family:monospace;font-size:1em} 30pre{white-space:pre-wrap} 31q{quotes:"\201C" "\201D" "\2018" "\2019"} 32small{font-size:80%} 33sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} 34sup{top:-.5em} 35sub{bottom:-.25em} 36img{border:0} 37svg:not(:root){overflow:hidden} 38figure{margin:0} 39fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em} 40legend{border:0;padding:0} 41button,input,select,textarea{font-family:inherit;font-size:100%;margin:0} 42button,input{line-height:normal} 43button,select{text-transform:none} 44button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer} 45button[disabled],html input[disabled]{cursor:default} 46input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0} 47button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0} 48textarea{overflow:auto;vertical-align:top} 49table{border-collapse:collapse;border-spacing:0} 50*,*::before,*::after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box} 51html,body{font-size:100%} 52body{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} 53a:hover{cursor:pointer} 54img,object,embed{max-width:100%;height:auto} 55object,embed{height:100%} 56img{-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} 64img,object,svg{display:inline-block;vertical-align:middle} 65textarea{height:auto;min-height:50px} 66select{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} 70div,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} 71a{color:#2156a5;text-decoration:underline;line-height:inherit} 72a:hover,a:focus{color:#1d4b8f} 73a img{border:none} 74p{font-family:inherit;font-weight:400;font-size:1em;line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility} 75p aside{font-size:.875em;line-height:1.35;font-style:italic} 76h1,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} 77h1 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} 78h1{font-size:2.125em} 79h2{font-size:1.6875em} 80h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em} 81h4,h5{font-size:1.125em} 82h6{font-size:1em} 83hr{border:solid #dddddf;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em;height:0} 84em,i{font-style:italic;line-height:inherit} 85strong,b{font-weight:bold;line-height:inherit} 86small{font-size:60%;line-height:inherit} 87code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;color:rgba(0,0,0,.9)} 88ul,ol,dl{font-size:1em;line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit} 89ul,ol{margin-left:1.5em} 90ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0;font-size:1em} 91ul.square li ul,ul.circle li ul,ul.disc li ul{list-style:inherit} 92ul.square{list-style-type:square} 93ul.circle{list-style-type:circle} 94ul.disc{list-style-type:disc} 95ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0} 96dl dt{margin-bottom:.3125em;font-weight:bold} 97dl dd{margin-bottom:1.25em} 98abbr,acronym{text-transform:uppercase;font-size:90%;color:rgba(0,0,0,.8);border-bottom:1px dotted #ddd;cursor:help} 99abbr{text-transform:none} 100blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd} 101blockquote cite{display:block;font-size:.9375em;color:rgba(0,0,0,.6)} 102blockquote cite::before{content:"\2014 \0020"} 103blockquote cite a,blockquote cite a:visited{color:rgba(0,0,0,.6)} 104blockquote,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} 106h1{font-size:2.75em} 107h2{font-size:2.3125em} 108h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em} 109h4{font-size:1.4375em}} 110table{background:#fff;margin-bottom:1.25em;border:solid 1px #dedede} 111table thead,table tfoot{background:#f7f8f7} 112table 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} 113table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)} 114table tr.even,table tr.alt,table tr:nth-of-type(even){background:#f8f8f7} 115table 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} 116h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em} 117h1 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} 123pre,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} 124em em{font-style:normal} 125strong strong{font-weight:400} 126.keyseq{color:rgba(51,51,51,.8)} 127kbd{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} 135b.button::before,b.button::after{position:relative;top:-1px;font-weight:400} 136b.button::before{content:"[";padding:0 3px 0 2px} 137b.button::after{content:"]";padding:0 2px 0 3px} 138p 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} 167body.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} 173body.toc2.toc-right{padding-left:0;padding-right:15em} 174body.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} 180body.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} 199table.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)} 201table.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:"$"} 231table.pyhltable{border-collapse:separate;border:0;margin-bottom:0;background:none} 232table.pyhltable td{vertical-align:top;padding-top:0;padding-bottom:0;line-height:1.45} 233table.pyhltable td.code{padding-left:.75em;padding-right:0} 234pre.pygments .lineno,table.pyhltable td:not(.code){color:#999;padding-left:0;padding-right:.5em;border-right:1px solid #dddddf} 235pre.pygments .lineno{display:inline-block;margin-right:.25em} 236table.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} 258table.tableblock{max-width:100%;border-collapse:separate} 259p.tableblock:last-child{margin-bottom:0} 260td.tableblock>.content{margin-bottom:-1.25em} 261table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede} 262table.grid-all>thead>tr>.tableblock,table.grid-all>tbody>tr>.tableblock{border-width:0 1px 1px 0} 263table.grid-all>tfoot>tr>.tableblock{border-width:1px 1px 0 0} 264table.grid-cols>*>tr>.tableblock{border-width:0 1px 0 0} 265table.grid-rows>thead>tr>.tableblock,table.grid-rows>tbody>tr>.tableblock{border-width:0 0 1px} 266table.grid-rows>tfoot>tr>.tableblock{border-width:1px 0 0} 267table.grid-all>*>tr>.tableblock:last-child,table.grid-cols>*>tr>.tableblock:last-child{border-right-width:0} 268table.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} 269table.frame-all{border-width:1px} 270table.frame-sides{border-width:0 1px} 271table.frame-topbot,table.frame-ends{border-width:1px 0} 272table.stripes-all tr,table.stripes-odd tr:nth-of-type(odd){background:#f8f8f7} 273table.stripes-none tr,table.stripes-odd tr:nth-of-type(even){background:none} 274th.halign-left,td.halign-left{text-align:left} 275th.halign-right,td.halign-right{text-align:right} 276th.halign-center,td.halign-center{text-align:center} 277th.valign-top,td.valign-top{vertical-align:top} 278th.valign-bottom,td.valign-bottom{vertical-align:bottom} 279th.valign-middle,td.valign-middle{vertical-align:middle} 280table thead th,table tfoot th{font-weight:bold} 281tbody tr th{display:table-cell;line-height:1.6;background:#f7f8f7} 282tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold} 283p.tableblock>code:only-child{background:none;padding:0} 284p.tableblock{font-size:1em} 285td>div.verse{white-space:pre} 286ol{margin-left:1.75em} 287ul li ol{margin-left:1.5em} 288dl dd{margin-left:1.125em} 289dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0} 290ol>li p,ul>li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em} 291ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none} 292ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:.625em} 293ul.unstyled,ol.unstyled{margin-left:0} 294ul.checklist{margin-left:.625em} 295ul.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} 296ul.checklist li>p:first-child>input[type="checkbox"]:first-child{margin-right:.25em} 297ul.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} 298ul.inline>li{margin-left:1.25em} 299.unstyled dl dt{font-weight:400;font-style:normal} 300ol.arabic{list-style-type:decimal} 301ol.decimal{list-style-type:decimal-leading-zero} 302ol.loweralpha{list-style-type:lower-alpha} 303ol.upperalpha{list-style-type:upper-alpha} 304ol.lowerroman{list-style-type:lower-roman} 305ol.upperroman{list-style-type:upper-roman} 306ol.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} 309td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em} 310td.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} 324a.image{text-decoration:none;display:inline-block} 325a.image object{pointer-events:none} 326sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super} 327sup.footnote a,sup.footnoteref a{text-decoration:none} 328sup.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%} 337div.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} 375span.icon>.fa{cursor:default} 376a 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)} 387pre .conum[data-value]{position:relative;top:-.125em} 388b.conum *{color:inherit!important} 389.conum:not([data-value]):empty{display:none} 390dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility} 391h1,h2,p,td.content,span.alt{letter-spacing:-.01em} 392p strong,td.content strong,div.footnote strong{letter-spacing:-.005em} 393p,blockquote,dt,td.content,span.alt{font-size:1.0625rem} 394p{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} 400html{font-size:80%} 401a{color:inherit!important;text-decoration:underline!important} 402a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important} 403a[href^="http:"]:not(.bare)::after,a[href^="https:"]:not(.bare)::after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em} 404abbr[title]::after{content:" (" attr(title) ")"} 405pre,blockquote,tr,img,object,svg{page-break-inside:avoid} 406thead{display:table-header-group} 407svg{max-width:100%} 408p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3} 409h2,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} 412body.book #header{text-align:center} 413body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em} 414body.book #header .details{border:0!important;display:block;padding:0!important} 415body.book #header .details span:first-child{margin-left:0!important} 416body.book #header .details br{display:block} 417body.book #header .details br+span::before{content:none!important} 418body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important} 419body.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.Assert</h1> 437<div class="details"> 438<span id="author" class="author">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="#assertion_macros">Assertion Macros, <boost/assert.hpp></a> 444<ul class="sectlevel2"> 445<li><a href="#boost_assert">BOOST_ASSERT</a></li> 446<li><a href="#boost_assert_msg">BOOST_ASSERT_MSG</a></li> 447<li><a href="#boost_verify">BOOST_VERIFY</a></li> 448<li><a href="#boost_verify_msg">BOOST_VERIFY_MSG</a></li> 449<li><a href="#boost_assert_is_void">BOOST_ASSERT_IS_VOID</a></li> 450</ul> 451</li> 452<li><a href="#current_function_macro">Current Function Macro, <boost/current_function.hpp></a> 453<ul class="sectlevel2"> 454<li><a href="#boost_current_function">BOOST_CURRENT_FUNCTION</a></li> 455</ul> 456</li> 457<li><a href="#source_location_support">Source Location Support, <boost/assert/source_location.hpp></a> 458<ul class="sectlevel2"> 459<li><a href="#description">Description</a></li> 460<li><a href="#synopsis">Synopsis</a></li> 461<li><a href="#source_location">source_location</a></li> 462<li><a href="#operator">operator<<</a></li> 463<li><a href="#boost_current_location">BOOST_CURRENT_LOCATION</a></li> 464</ul> 465</li> 466<li><a href="#changes">Revision History</a> 467<ul class="sectlevel2"> 468<li><a href="#changes_in_1_73_0">Changes in 1.73.0</a></li> 469</ul> 470</li> 471<li><a href="#copyright_and_license">Appendix A: Copyright and License</a></li> 472</ul> 473</div> 474</div> 475<div id="content"> 476<div id="preamble"> 477<div class="sectionbody"> 478<div class="paragraph"> 479<p>The Boost.Assert library provides several configurable diagnostic macros 480similar in behavior and purpose to the standard macro <code>assert</code> from <code><cassert></code>.</p> 481</div> 482</div> 483</div> 484<div class="sect1"> 485<h2 id="assertion_macros">Assertion Macros, <boost/assert.hpp></h2> 486<div class="sectionbody"> 487<div class="sect2"> 488<h3 id="boost_assert">BOOST_ASSERT</h3> 489<div class="paragraph"> 490<p>The header <code><boost/assert.hpp></code> defines the macro <code>BOOST_ASSERT</code>, 491which is similar to the standard <code>assert</code> macro defined in <code><cassert></code>. 492The macro is intended to be used in both Boost libraries and user 493code.</p> 494</div> 495<div class="ulist"> 496<ul> 497<li> 498<p>By default, <code>BOOST_ASSERT(expr)</code> expands to <code>assert(expr)</code>.</p> 499</li> 500<li> 501<p>If the macro <code>BOOST_DISABLE_ASSERTS</code> is defined when <code><boost/assert.hpp></code> 502is included, <code>BOOST_ASSERT(expr)</code> expands to <code>((void)0)</code>, regardless of whether 503the macro <code>NDEBUG</code> is defined. This allows users to selectively disable <code>BOOST_ASSERT</code> without 504affecting the definition of the standard <code>assert</code>.</p> 505</li> 506<li> 507<p>If the macro <code>BOOST_ENABLE_ASSERT_HANDLER</code> is defined when <code><boost/assert.hpp></code> 508is included, <code>BOOST_ASSERT(expr)</code> expands to</p> 509<div class="listingblock"> 510<div class="content"> 511<pre class="highlight"><code>(BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed(#expr, 512 BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))</code></pre> 513</div> 514</div> 515<div class="paragraph"> 516<p>That is, it evaluates <code>expr</code> and if it’s false, calls 517<code>::boost::assertion_failed(#expr, <a href="#boost_current_function">BOOST_CURRENT_FUNCTION</a>, __FILE__, __LINE__)</code>. 518This is true regardless of whether <code>NDEBUG</code> is defined.</p> 519</div> 520<div class="paragraph"> 521<p><code>boost::assertion_failed</code> is declared in <code><boost/assert.hpp></code> as</p> 522</div> 523<div class="listingblock"> 524<div class="content"> 525<pre class="highlight"><code>namespace boost 526{ 527 void assertion_failed(char const * expr, char const * function, 528 char const * file, long line); 529}</code></pre> 530</div> 531</div> 532<div class="paragraph"> 533<p>but it is never defined. The user is expected to supply an appropriate definition.</p> 534</div> 535</li> 536<li> 537<p>If the macro <code>BOOST_ENABLE_ASSERT_DEBUG_HANDLER</code> is defined when <code><boost/assert.hpp></code> 538is included, <code>BOOST_ASSERT(expr)</code> expands to <code>((void)0)</code> when <code>NDEBUG</code> is 539defined. Otherwise the behavior is as if <code>BOOST_ENABLE_ASSERT_HANDLER</code> has been defined.</p> 540</li> 541</ul> 542</div> 543<div class="paragraph"> 544<p>As is the case with <code><cassert></code>, <code><boost/assert.hpp></code> 545can be included multiple times in a single translation unit. <code>BOOST_ASSERT</code> 546will be redefined each time as specified above.</p> 547</div> 548</div> 549<div class="sect2"> 550<h3 id="boost_assert_msg">BOOST_ASSERT_MSG</h3> 551<div class="paragraph"> 552<p>The macro <code>BOOST_ASSERT_MSG</code> is similar to <code>BOOST_ASSERT</code>, but it takes an additional argument, 553a character literal, supplying an error message.</p> 554</div> 555<div class="ulist"> 556<ul> 557<li> 558<p>By default, <code>BOOST_ASSERT_MSG(expr,msg)</code> expands to <code>assert((expr)&&(msg))</code>.</p> 559</li> 560<li> 561<p>If the macro <code>BOOST_DISABLE_ASSERTS</code> is defined when <code><boost/assert.hpp></code> 562is included, <code>BOOST_ASSERT_MSG(expr,msg)</code> expands to <code>((void)0)</code>, regardless of whether 563the macro <code>NDEBUG</code> is defined.</p> 564</li> 565<li> 566<p>If the macro <code>BOOST_ENABLE_ASSERT_HANDLER</code> is defined when <code><boost/assert.hpp></code> 567is included, <code>BOOST_ASSERT_MSG(expr,msg)</code> expands to</p> 568<div class="listingblock"> 569<div class="content"> 570<pre class="highlight"><code>(BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed_msg(#expr, 571 msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))</code></pre> 572</div> 573</div> 574<div class="paragraph"> 575<p>This is true regardless of whether <code>NDEBUG</code> is defined.</p> 576</div> 577<div class="paragraph"> 578<p><code>boost::assertion_failed_msg</code> is declared in <code><boost/assert.hpp></code> as</p> 579</div> 580<div class="listingblock"> 581<div class="content"> 582<pre class="highlight"><code>namespace boost 583{ 584 void assertion_failed_msg(char const * expr, char const * msg, 585 char const * function, char const * file, long line); 586}</code></pre> 587</div> 588</div> 589<div class="paragraph"> 590<p>but it is never defined. The user is expected to supply an appropriate definition.</p> 591</div> 592</li> 593<li> 594<p>If the macro <code>BOOST_ENABLE_ASSERT_DEBUG_HANDLER</code> is defined when <code><boost/assert.hpp></code> 595is included, <code>BOOST_ASSERT_MSG(expr)</code> expands to <code>((void)0)</code> when <code>NDEBUG</code> is 596defined. Otherwise the behavior is as if <code>BOOST_ENABLE_ASSERT_HANDLER</code> has been defined.</p> 597</li> 598</ul> 599</div> 600<div class="paragraph"> 601<p>As is the case with <code><cassert></code>, <code><boost/assert.hpp></code> 602can be included multiple times in a single translation unit. <code>BOOST_ASSERT_MSG</code> 603will be redefined each time as specified above.</p> 604</div> 605</div> 606<div class="sect2"> 607<h3 id="boost_verify">BOOST_VERIFY</h3> 608<div class="paragraph"> 609<p>The macro <code>BOOST_VERIFY</code> has the same behavior as <code>BOOST_ASSERT</code>, except that 610the expression that is passed to <code>BOOST_VERIFY</code> is always 611evaluated. This is useful when the asserted expression has desirable side 612effects; it can also help suppress warnings about unused variables when the 613only use of the variable is inside an assertion.</p> 614</div> 615<div class="ulist"> 616<ul> 617<li> 618<p>If the macro <code>BOOST_DISABLE_ASSERTS</code> is defined when <code><boost/assert.hpp></code> 619is included, <code>BOOST_VERIFY(expr)</code> expands to <code>((void)(expr))</code>.</p> 620</li> 621<li> 622<p>If the macro <code>BOOST_ENABLE_ASSERT_HANDLER</code> is defined when <code><boost/assert.hpp></code> 623is included, <code>BOOST_VERIFY(expr)</code> expands to <code>BOOST_ASSERT(expr)</code>.</p> 624</li> 625<li> 626<p>Otherwise, <code>BOOST_VERIFY(expr)</code> expands to <code>((void)(expr))</code> when <code>NDEBUG</code> is 627defined, to <code>BOOST_ASSERT(expr)</code> when it’s not.</p> 628</li> 629</ul> 630</div> 631</div> 632<div class="sect2"> 633<h3 id="boost_verify_msg">BOOST_VERIFY_MSG</h3> 634<div class="paragraph"> 635<p>The macro <code>BOOST_VERIFY_MSG</code> is similar to <code>BOOST_VERIFY</code>, with an additional parameter, an error message.</p> 636</div> 637<div class="ulist"> 638<ul> 639<li> 640<p>If the macro <code>BOOST_DISABLE_ASSERTS</code> is defined when <code><boost/assert.hpp></code> 641is included, <code>BOOST_VERIFY_MSG(expr,msg)</code> expands to <code>((void)(expr))</code>.</p> 642</li> 643<li> 644<p>If the macro <code>BOOST_ENABLE_ASSERT_HANDLER</code> is defined when <code><boost/assert.hpp></code> 645is included, <code>BOOST_VERIFY_MSG(expr,msg)</code> expands to <code>BOOST_ASSERT_MSG(expr,msg)</code>.</p> 646</li> 647<li> 648<p>Otherwise, <code>BOOST_VERIFY_MSG(expr,msg)</code> expands to <code>((void)(expr))</code> when <code>NDEBUG</code> is 649defined, to <code>BOOST_ASSERT_MSG(expr,msg)</code> when it’s not.</p> 650</li> 651</ul> 652</div> 653</div> 654<div class="sect2"> 655<h3 id="boost_assert_is_void">BOOST_ASSERT_IS_VOID</h3> 656<div class="paragraph"> 657<p>The macro <code>BOOST_ASSERT_IS_VOID</code> is defined when <code>BOOST_ASSERT</code> and <code>BOOST_ASSERT_MSG</code> are expanded to <code>((void)0)</code>. 658Its purpose is to avoid compiling and potentially running code that is only intended to prepare data to be used in the assertion.</p> 659</div> 660<div class="listingblock"> 661<div class="content"> 662<pre class="highlight"><code>void MyContainer::erase(iterator i) 663{ 664// Some sanity checks, data must be ordered 665#ifndef BOOST_ASSERT_IS_VOID 666 667 if(i != c.begin()) { 668 iterator prev = i; 669 --prev; 670 BOOST_ASSERT(*prev < *i); 671 } 672 else if(i != c.end()) { 673 iterator next = i; 674 ++next; 675 BOOST_ASSERT(*i < *next); 676 } 677 678#endif 679 680 this->erase_impl(i); 681}</code></pre> 682</div> 683</div> 684<div class="ulist"> 685<ul> 686<li> 687<p>By default, <code>BOOST_ASSERT_IS_VOID</code> is defined if <code>NDEBUG</code> is defined.</p> 688</li> 689<li> 690<p>If the macro <code>BOOST_DISABLE_ASSERTS</code> is defined, <code>BOOST_ASSERT_IS_VOID</code> is always defined.</p> 691</li> 692<li> 693<p>If the macro <code>BOOST_ENABLE_ASSERT_HANDLER</code> is defined, <code>BOOST_ASSERT_IS_VOID</code> is never defined.</p> 694</li> 695<li> 696<p>If the macro <code>BOOST_ENABLE_ASSERT_DEBUG_HANDLER</code> is defined, then <code>BOOST_ASSERT_IS_VOID</code> is defined when <code>NDEBUG</code> is defined.</p> 697</li> 698</ul> 699</div> 700</div> 701</div> 702</div> 703<div class="sect1"> 704<h2 id="current_function_macro">Current Function Macro, <boost/current_function.hpp></h2> 705<div class="sectionbody"> 706<div class="sect2"> 707<h3 id="boost_current_function">BOOST_CURRENT_FUNCTION</h3> 708<div class="paragraph"> 709<p>The header <code><boost/current_function.hpp></code> defines a single macro, <code>BOOST_CURRENT_FUNCTION</code>, 710similar to the C99 predefined identifier <code>__func__</code>.</p> 711</div> 712<div class="paragraph"> 713<p><code>BOOST_CURRENT_FUNCTION</code> expands to a string literal containing 714the (fully qualified, if possible) name of the enclosing function. If there is 715no enclosing function, the behavior is unspecified.</p> 716</div> 717<div class="paragraph"> 718<p>Some compilers do not provide a way to obtain the name of the current enclosing 719function. On such compilers, or when the macro <code>BOOST_DISABLE_CURRENT_FUNCTION</code> 720is defined, <code>BOOST_CURRENT_FUNCTION</code> expands to <code>"(unknown)"</code>.</p> 721</div> 722<div class="paragraph"> 723<p><code>BOOST_DISABLE_CURRENT_FUNCTION</code> addresses a use case in which the programmer 724wishes to eliminate the string literals produced by <code>BOOST_CURRENT_FUNCTION</code> from 725the final executable for security reasons.</p> 726</div> 727</div> 728</div> 729</div> 730<div class="sect1"> 731<h2 id="source_location_support">Source Location Support, <boost/assert/source_location.hpp></h2> 732<div class="sectionbody"> 733<div class="sect2"> 734<h3 id="description">Description</h3> 735<div class="paragraph"> 736<p>The header <code><boost/assert/source_location.hpp></code> defines <code>source_location</code>, 737a class representing a source location and containing file, line, function 738and column information. It’s similar to <code>std::source_location</code> from C++20, 739but only requires C++03.</p> 740</div> 741<div class="paragraph"> 742<p>The macro <code>BOOST_CURRENT_LOCATION</code> creates a <code>source_location</code> object 743containing information about the current source location.</p> 744</div> 745</div> 746<div class="sect2"> 747<h3 id="synopsis">Synopsis</h3> 748<div class="listingblock"> 749<div class="content"> 750<pre class="highlight"><code>namespace boost 751{ 752 753struct source_location 754{ 755 constexpr source_location() noexcept; 756 constexpr source_location(char const* file, uint_least32_t line, 757 char const* function, uint_least32_t column = 0) noexcept; 758 759 constexpr char const* file_name() const noexcept; 760 constexpr char const* function_name() const noexcept; 761 constexpr uint_least32_t line() const noexcept; 762 constexpr uint_least32_t column() const noexcept; 763}; 764 765template<class E, class T> 766 std::basic_ostream<E, T> & 767 operator<<( std::basic_ostream<E, T> & os, source_location const & loc ); 768 769} // namespace boost 770 771#define BOOST_CURRENT_LOCATION \ 772 ::boost::source_location(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION)</code></pre> 773</div> 774</div> 775</div> 776<div class="sect2"> 777<h3 id="source_location">source_location</h3> 778<div class="listingblock"> 779<div class="content"> 780<pre class="highlight"><code>constexpr source_location() noexcept;</code></pre> 781</div> 782</div> 783<div class="dlist"> 784<dl> 785<dt class="hdlist1">Effects: </dt> 786<dd> 787<p>Constructs a <code>source_location</code> object for which <code>file_name()</code> 788and <code>function_name()</code> return <code>"(unknown)"</code>, and <code>line()</code> and <code>column()</code> 789return <code>0</code>.</p> 790</dd> 791</dl> 792</div> 793<div class="listingblock"> 794<div class="content"> 795<pre class="highlight"><code>constexpr source_location(char const* file, uint_least32_t line, 796 char const* function, uint_least32_t column = 0) noexcept;</code></pre> 797</div> 798</div> 799<div class="dlist"> 800<dl> 801<dt class="hdlist1">Effects: </dt> 802<dd> 803<p>Constructs a <code>source_location</code> object for which <code>file_name()</code> 804returns <code>file</code>, <code>function_name()</code> returns <code>function</code>, <code>line()</code> returns the 805<code>line</code> argument and <code>column()</code> returns the <code>column</code> argument.</p> 806</dd> 807</dl> 808</div> 809</div> 810<div class="sect2"> 811<h3 id="operator">operator<<</h3> 812<div class="listingblock"> 813<div class="content"> 814<pre class="highlight"><code>template<class E, class T> 815 std::basic_ostream<E, T> & 816 operator<<( std::basic_ostream<E, T> & os, source_location const & loc );</code></pre> 817</div> 818</div> 819<div class="dlist"> 820<dl> 821<dt class="hdlist1">Effects: </dt> 822<dd> 823<p>Outputs a string representation of <code>loc</code> to <code>os</code>.</p> 824</dd> 825<dt class="hdlist1">Returns: </dt> 826<dd> 827<p><code>os</code>.</p> 828</dd> 829</dl> 830</div> 831</div> 832<div class="sect2"> 833<h3 id="boost_current_location">BOOST_CURRENT_LOCATION</h3> 834<div class="paragraph"> 835<p>When <code>BOOST_DISABLE_CURRENT_LOCATION</code> is not defined, the definition of 836<code>BOOST_CURRENT_LOCATION</code> is:</p> 837</div> 838<div class="listingblock"> 839<div class="content"> 840<pre class="highlight"><code>#define BOOST_CURRENT_LOCATION \ 841 ::boost::source_location(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION)</code></pre> 842</div> 843</div> 844<div class="paragraph"> 845<p>Otherwise, <code>BOOST_CURRENT_LOCATION</code> is defined as:</p> 846</div> 847<div class="listingblock"> 848<div class="content"> 849<pre class="highlight"><code>#define BOOST_CURRENT_LOCATION ::boost::source_location()</code></pre> 850</div> 851</div> 852<div class="paragraph"> 853<p>This allows producing executables that contain no identifying information, 854for security reasons.</p> 855</div> 856</div> 857</div> 858</div> 859<div class="sect1"> 860<h2 id="changes">Revision History</h2> 861<div class="sectionbody"> 862<div class="sect2"> 863<h3 id="changes_in_1_73_0">Changes in 1.73.0</h3> 864<div class="ulist"> 865<ul> 866<li> 867<p>Added <code>source_location</code>.</p> 868</li> 869</ul> 870</div> 871</div> 872</div> 873</div> 874<div class="sect1"> 875<h2 id="copyright_and_license">Appendix A: Copyright and License</h2> 876<div class="sectionbody"> 877<div class="paragraph"> 878<p>This documentation is</p> 879</div> 880<div class="ulist"> 881<ul> 882<li> 883<p>Copyright 2002, 2007, 2014, 2017, 2019, 2020 Peter Dimov</p> 884</li> 885<li> 886<p>Copyright 2011 Beman Dawes</p> 887</li> 888<li> 889<p>Copyright 2015 Ion GaztaƱaga</p> 890</li> 891<li> 892<p>Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</p> 893</li> 894</ul> 895</div> 896</div> 897</div> 898</div> 899<div id="footer"> 900<div id="footer-text"> 901Last updated 2020-08-11 14:55:34 UTC 902</div> 903</div> 904<style> 905 906*:not(pre)>code { background: none; color: #600000; } 907:not(pre):not([class^=L])>code { background: none; color: #600000; } 908 909</style> 910</body> 911</html>