From f5eda28c9fdb02586a68894a6057fbd75664e013 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 5 Jun 2017 18:20:02 +0300 Subject: [PATCH 01/22] Add .adoc files --- doc/assert.adoc | 148 ++++++++++++++++++++++++++++++++++++++ doc/current_function.adoc | 21 ++++++ doc/index.adoc | 16 +++++ 3 files changed, 185 insertions(+) create mode 100644 doc/assert.adoc create mode 100644 doc/current_function.adoc create mode 100644 doc/index.adoc diff --git a/doc/assert.adoc b/doc/assert.adoc new file mode 100644 index 0000000..5c1e4a9 --- /dev/null +++ b/doc/assert.adoc @@ -0,0 +1,148 @@ +//// +Copyright 2002, 2007, 2014, 2017 Peter Dimov +Copyright 2011 Beman Dawes +Copyright 2015 Ion Gaztanaga + +Distributed under the Boost Software License, Version 1.0. + +See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt +//// + +# +:toc: + +## BOOST_ASSERT + +The header `` defines the macro `BOOST_ASSERT`, +which is similar to the standard `assert` macro defined in ``. +The macro is intended to be used in both Boost libraries and user +code. + +* By default, `BOOST_ASSERT(expr)` expands to `assert(expr)`. + +* If the macro `BOOST_DISABLE_ASSERTS` is defined when `` + is included, `BOOST_ASSERT(expr)` expands to `((void)0)`, regardless of whether + the macro `NDEBUG` is defined. This allows users to selectively disable `BOOST_ASSERT` without + affecting the definition of the standard `assert`. + +* If the macro `BOOST_ENABLE_ASSERT_HANDLER` is defined when `` + is included, `BOOST_ASSERT(expr)` expands to +``` +(BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) +``` + That is, it evaluates `expr` and if it's false, calls `::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)`. + This is true regardless of whether `NDEBUG` is defined. + `boost::assertion_failed` is declared in `` as +``` +namespace boost +{ + void assertion_failed(char const * expr, char const * function, char const * file, long line); +} +``` +but it is never defined. The user is expected to supply an appropriate +definition. + +* If the macro `BOOST_ENABLE_ASSERT_DEBUG_HANDLER` is defined when `` +is included, `BOOST_ASSERT(expr)` expands to `((void)0)` when `NDEBUG` is +defined. Otherwise the behavior is as if `BOOST_ENABLE_ASSERT_HANDLER` has been defined. + +As is the case with ``, `` +can be included multiple times in a single translation unit. `BOOST_ASSERT` +will be redefined each time as specified above. + +## BOOST_ASSERT_MSG + +The macro `BOOST_ASSERT_MSG` is similar to `BOOST_ASSERT`, but it takes an additional argument, +a character literal, supplying an error message. + +* By default, `BOOST_ASSERT_MSG(expr,msg)` expands to `assert((expr)&&(msg))`. + +* If the macro `BOOST_DISABLE_ASSERTS` is defined when `` +is included, `BOOST_ASSERT_MSG(expr,msg)` expands to `((void)0)`, regardless of whether +the macro `NDEBUG` is defined. + +* If the macro `BOOST_ENABLE_ASSERT_HANDLER` is defined when `` +is included, `BOOST_ASSERT_MSG(expr,msg)` expands to +``` +(BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) +``` +This is true regardless of whether `NDEBUG` is defined. + +`boost::assertion_failed_msg` is declared in `` as +``` +namespace boost +{ + void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line); +} +``` +but it is never defined. The user is expected to supply an appropriate +definition. + +* If the macro `BOOST_ENABLE_ASSERT_DEBUG_HANDLER` is defined when `` +is included, `BOOST_ASSERT_MSG(expr)` expands to `((void)0)` when `NDEBUG` is +defined. Otherwise the behavior is as if `BOOST_ENABLE_ASSERT_HANDLER` has been defined. + +As is the case with ``, `` +can be included multiple times in a single translation unit. `BOOST_ASSERT_MSG` +will be redefined each time as specified above. + +## BOOST_VERIFY + +The macro `BOOST_VERIFY` has the same behavior as `BOOST_ASSERT`, except that +the expression that is passed to `BOOST_VERIFY` is always +evaluated. This is useful when the asserted expression has desirable side +effects; it can also help suppress warnings about unused variables when the +only use of the variable is inside an assertion. + +* If the macro `BOOST_DISABLE_ASSERTS` is defined when `` + is included, `BOOST_VERIFY(expr)` expands to `((void)(expr))`. + +* If the macro `BOOST_ENABLE_ASSERT_HANDLER` is defined when `` + is included, `BOOST_VERIFY(expr)` expands to `BOOST_ASSERT(expr)`. + +* Otherwise, `BOOST_VERIFY(expr)` expands to `((void)(expr))` when `NDEBUG` is + defined, to `BOOST_ASSERT(expr)` when it's not. + +## BOOST_VERIFY_MSG + +The macro `BOOST_VERIFY_MSG` is similar to `BOOST_VERIFY`, with an additional parameter, an error message. + +* If the macro `BOOST_DISABLE_ASSERTS` is defined when `` + is included, `BOOST_VERIFY_MSG(expr,msg)` expands to `((void)(expr))`. + +* If the macro `BOOST_ENABLE_ASSERT_HANDLER` is defined when `` + is included, `BOOST_VERIFY_MSG(expr,msg)` expands to `BOOST_ASSERT_MSG(expr,msg)`. + +* Otherwise, `BOOST_VERIFY_MSG(expr,msg)` expands to `((void)(expr))` when `NDEBUG` is + defined, to `BOOST_ASSERT_MSG(expr,msg)` when it's not. + +## BOOST_ASSERT_IS_VOID + +The macro `BOOST_ASSERT_IS_VOID` is defined when `BOOST_ASSERT` and `BOOST_ASSERT_MSG` are expanded to `((void)0)`. +Its purpose is to avoid compiling and potentially running code that is only intended to prepare data to be used in the assertion. + +``` +void MyContainer::erase(iterator i) +{ + //Some sanity checks, data must be ordered + #ifndef BOOST_ASSERT_IS_VOID + if(i != c.begin()){ + iterator prev = i; + --prev; + BOOST_ASSERT(*prev < *i); + } + else if(i != c.end()){ + iterator next = i; + ++next; + BOOST_ASSERT(*i < *next); + } + #endif + this->erase_impl(i); +} +``` + +* By default, `BOOST_ASSERT_IS_VOID` is defined if `NDEBUG` is defined. +* If the macro `BOOST_DISABLE_ASSERTS` is defined, `BOOST_ASSERT_IS_VOID` is always defined. +* If the macro `BOOST_ENABLE_ASSERT_HANDLER` is defined, `BOOST_ASSERT_IS_VOID` is never defined. +* If the macro `BOOST_ENABLE_ASSERT_DEBUG_HANDLER` is defined, then `BOOST_ASSERT_IS_VOID` is defined when `NDEBUG` is defined. diff --git a/doc/current_function.adoc b/doc/current_function.adoc new file mode 100644 index 0000000..f202316 --- /dev/null +++ b/doc/current_function.adoc @@ -0,0 +1,21 @@ +//// +Copyright 2002, 2017 Peter Dimov + +Distributed under the Boost Software License, Version 1.0. + +See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt +//// + +## BOOST_CURRENT_FUNCTION + +The header `boost/current_function.hpp` defines a single macro, `BOOST_CURRENT_FUNCTION`, +similar to the C99 predefined identifier `__func__`. + +`BOOST_CURRENT_FUNCTION` expands to a string literal containing +the (fully qualified, if possible) name of the enclosing function. If there is +no enclosing function, the behavior is unspecified. + +Some compilers do not provide a way to obtain the name of the current enclosing +function. On such compilers, `BOOST_CURRENT_FUNCTION` expands to +`"(unknown)"`. diff --git a/doc/index.adoc b/doc/index.adoc new file mode 100644 index 0000000..944083f --- /dev/null +++ b/doc/index.adoc @@ -0,0 +1,16 @@ +//// +Copyright 2017 Peter Dimov + +Distributed under the Boost Software License, Version 1.0. + +See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt +//// + +# Boost.Assert + +The Boost.Assert library... + +include::assert.adoc[] + +include::current_function.adoc[] From 1e63b47508dd614183c0a03434b0ccccb409b389 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 5 Jun 2017 18:23:12 +0300 Subject: [PATCH 02/22] Update current_function.adoc --- doc/current_function.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/current_function.adoc b/doc/current_function.adoc index f202316..4b8cbe2 100644 --- a/doc/current_function.adoc +++ b/doc/current_function.adoc @@ -9,8 +9,8 @@ http://www.boost.org/LICENSE_1_0.txt ## BOOST_CURRENT_FUNCTION -The header `boost/current_function.hpp` defines a single macro, `BOOST_CURRENT_FUNCTION`, -similar to the C99 predefined identifier `__func__`. +The header `` defines a single macro, `BOOST_CURRENT_FUNCTION`, +similar to the C99 predefined identifier `\\__func__`. `BOOST_CURRENT_FUNCTION` expands to a string literal containing the (fully qualified, if possible) name of the enclosing function. If there is From eb13a1675078e2c77eb08a2c6cb59daf4f83367c Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 5 Jun 2017 18:29:24 +0300 Subject: [PATCH 03/22] Update assert.adoc --- doc/assert.adoc | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/doc/assert.adoc b/doc/assert.adoc index 5c1e4a9..e57f43d 100644 --- a/doc/assert.adoc +++ b/doc/assert.adoc @@ -9,7 +9,7 @@ See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt //// -# +# assert.hpp :toc: ## BOOST_ASSERT @@ -29,15 +29,17 @@ code. * If the macro `BOOST_ENABLE_ASSERT_HANDLER` is defined when `` is included, `BOOST_ASSERT(expr)` expands to ``` -(BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) +(BOOST_LIKELY(!!(expr))? ((void)0): + ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) ``` - That is, it evaluates `expr` and if it's false, calls `::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)`. - This is true regardless of whether `NDEBUG` is defined. - `boost::assertion_failed` is declared in `` as +That is, it evaluates `expr` and if it's false, calls `::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)`. +This is true regardless of whether `NDEBUG` is defined. + +`boost::assertion_failed` is declared in `` as ``` namespace boost { - void assertion_failed(char const * expr, char const * function, char const * file, long line); + void assertion_failed(char const * expr, char const * function, char const * file, long line); } ``` but it is never defined. The user is expected to supply an appropriate @@ -65,7 +67,8 @@ the macro `NDEBUG` is defined. * If the macro `BOOST_ENABLE_ASSERT_HANDLER` is defined when `` is included, `BOOST_ASSERT_MSG(expr,msg)` expands to ``` -(BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) +(BOOST_LIKELY(!!(expr))? ((void)0): + ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) ``` This is true regardless of whether `NDEBUG` is defined. @@ -73,7 +76,8 @@ This is true regardless of whether `NDEBUG` is defined. ``` namespace boost { - void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line); + void assertion_failed_msg(char const * expr, char const * msg, char const * function, + char const * file, long line); } ``` but it is never defined. The user is expected to supply an appropriate @@ -125,20 +129,23 @@ Its purpose is to avoid compiling and potentially running code that is only inte ``` void MyContainer::erase(iterator i) { - //Some sanity checks, data must be ordered - #ifndef BOOST_ASSERT_IS_VOID - if(i != c.begin()){ +// Some sanity checks, data must be ordered +#ifndef BOOST_ASSERT_IS_VOID + + if(i != c.begin()) { iterator prev = i; --prev; BOOST_ASSERT(*prev < *i); - } - else if(i != c.end()){ + } + else if(i != c.end()) { iterator next = i; ++next; BOOST_ASSERT(*i < *next); - } - #endif - this->erase_impl(i); + } + +#endif + + this->erase_impl(i); } ``` From 7bd364f684ca6bf9c83a98dbf2b34c547969ddff Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 5 Jun 2017 18:30:45 +0300 Subject: [PATCH 04/22] Update current_function.adoc --- doc/current_function.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/current_function.adoc b/doc/current_function.adoc index 4b8cbe2..3514ce7 100644 --- a/doc/current_function.adoc +++ b/doc/current_function.adoc @@ -7,6 +7,9 @@ See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt //// +# current_function.hpp +:toc: + ## BOOST_CURRENT_FUNCTION The header `` defines a single macro, `BOOST_CURRENT_FUNCTION`, From e6e1333a48c1fff371b1a350f3eab223c844e202 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 5 Jun 2017 18:33:08 +0300 Subject: [PATCH 05/22] Update index.adoc --- doc/index.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/index.adoc b/doc/index.adoc index 944083f..7d3915e 100644 --- a/doc/index.adoc +++ b/doc/index.adoc @@ -8,8 +8,10 @@ http://www.boost.org/LICENSE_1_0.txt //// # Boost.Assert +:toc: -The Boost.Assert library... +The Boost.Assert library provides several configurable diagnostic macros +similar in behavior and purpose to the standard macro `assert` from ``. include::assert.adoc[] From a3a3696d1ee19a6553f04a313b4b466b0bc798ee Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 5 Jun 2017 18:35:42 +0300 Subject: [PATCH 06/22] Update assert.adoc --- doc/assert.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/assert.adoc b/doc/assert.adoc index e57f43d..9252c79 100644 --- a/doc/assert.adoc +++ b/doc/assert.adoc @@ -11,6 +11,7 @@ http://www.boost.org/LICENSE_1_0.txt # assert.hpp :toc: +:toc-title: ## BOOST_ASSERT From 871efc9961c8739ca934242a24a7f390bad22a00 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 5 Jun 2017 18:36:26 +0300 Subject: [PATCH 07/22] Update current_function.adoc --- doc/current_function.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/current_function.adoc b/doc/current_function.adoc index 3514ce7..c9b549b 100644 --- a/doc/current_function.adoc +++ b/doc/current_function.adoc @@ -7,8 +7,9 @@ See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt //// -# current_function.hpp +# boost/current_function.hpp :toc: +:toc-title: ## BOOST_CURRENT_FUNCTION From 705e31eaddb23037a99010d984530ecf043f7430 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 5 Jun 2017 18:36:57 +0300 Subject: [PATCH 08/22] Update assert.adoc --- doc/assert.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/assert.adoc b/doc/assert.adoc index 9252c79..c73b239 100644 --- a/doc/assert.adoc +++ b/doc/assert.adoc @@ -9,7 +9,7 @@ See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt //// -# assert.hpp +# boost/assert.hpp :toc: :toc-title: From cdc9685ecf88195702655bf9bd0ac731a047877e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 5 Jun 2017 18:45:01 +0300 Subject: [PATCH 09/22] Update assert.adoc --- doc/assert.adoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/assert.adoc b/doc/assert.adoc index c73b239..060291f 100644 --- a/doc/assert.adoc +++ b/doc/assert.adoc @@ -33,7 +33,7 @@ code. (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) ``` -That is, it evaluates `expr` and if it's false, calls `::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)`. +That is, it evaluates `expr` and if it's false, calls `::boost::assertion_failed(#expr, <>, \\__FILE__, \\__LINE__)`. This is true regardless of whether `NDEBUG` is defined. `boost::assertion_failed` is declared in `` as @@ -59,7 +59,7 @@ will be redefined each time as specified above. The macro `BOOST_ASSERT_MSG` is similar to `BOOST_ASSERT`, but it takes an additional argument, a character literal, supplying an error message. -* By default, `BOOST_ASSERT_MSG(expr,msg)` expands to `assert((expr)&&(msg))`. +* By default, `BOOST_ASSERT_MSG(expr,msg)` expands to `assert\((expr)&&(msg))`. * If the macro `BOOST_DISABLE_ASSERTS` is defined when `` is included, `BOOST_ASSERT_MSG(expr,msg)` expands to `((void)0)`, regardless of whether @@ -101,12 +101,12 @@ effects; it can also help suppress warnings about unused variables when the only use of the variable is inside an assertion. * If the macro `BOOST_DISABLE_ASSERTS` is defined when `` - is included, `BOOST_VERIFY(expr)` expands to `((void)(expr))`. + is included, `BOOST_VERIFY(expr)` expands to `\((void)(expr))`. * If the macro `BOOST_ENABLE_ASSERT_HANDLER` is defined when `` is included, `BOOST_VERIFY(expr)` expands to `BOOST_ASSERT(expr)`. -* Otherwise, `BOOST_VERIFY(expr)` expands to `((void)(expr))` when `NDEBUG` is +* Otherwise, `BOOST_VERIFY(expr)` expands to `\((void)(expr))` when `NDEBUG` is defined, to `BOOST_ASSERT(expr)` when it's not. ## BOOST_VERIFY_MSG @@ -114,12 +114,12 @@ only use of the variable is inside an assertion. The macro `BOOST_VERIFY_MSG` is similar to `BOOST_VERIFY`, with an additional parameter, an error message. * If the macro `BOOST_DISABLE_ASSERTS` is defined when `` - is included, `BOOST_VERIFY_MSG(expr,msg)` expands to `((void)(expr))`. + is included, `BOOST_VERIFY_MSG(expr,msg)` expands to `\((void)(expr))`. * If the macro `BOOST_ENABLE_ASSERT_HANDLER` is defined when `` is included, `BOOST_VERIFY_MSG(expr,msg)` expands to `BOOST_ASSERT_MSG(expr,msg)`. -* Otherwise, `BOOST_VERIFY_MSG(expr,msg)` expands to `((void)(expr))` when `NDEBUG` is +* Otherwise, `BOOST_VERIFY_MSG(expr,msg)` expands to `\((void)(expr))` when `NDEBUG` is defined, to `BOOST_ASSERT_MSG(expr,msg)` when it's not. ## BOOST_ASSERT_IS_VOID From bfcfebc7b14334a6f0a53201c2d5e7b1ba7fc4f9 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 5 Jun 2017 18:53:28 +0300 Subject: [PATCH 10/22] Update current_function.adoc --- doc/current_function.adoc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/current_function.adoc b/doc/current_function.adoc index c9b549b..9c96170 100644 --- a/doc/current_function.adoc +++ b/doc/current_function.adoc @@ -21,5 +21,9 @@ the (fully qualified, if possible) name of the enclosing function. If there is no enclosing function, the behavior is unspecified. Some compilers do not provide a way to obtain the name of the current enclosing -function. On such compilers, `BOOST_CURRENT_FUNCTION` expands to -`"(unknown)"`. +function. On such compilers, or when the macro `BOOST_DISABLE_CURRENT_FUNCTION` +is defined, `BOOST_CURRENT_FUNCTION` expands to `"(unknown)"`. + +`BOOST_DISABLE_CURRENT_FUNCTION` addresses a use case in which the programmer +wishes to eliminate the string literals produced by `BOOST_CURRENT_FUNCTION` from +the final executable for security reasons. From 215f529b84fb75562fcccd55dcd9eb26500fec98 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 6 Jun 2017 02:19:26 +0300 Subject: [PATCH 11/22] Update documentation, add Jamfile --- doc/Jamfile | 54 +++ doc/asciidoctor.jam | 24 ++ doc/assert.adoc | 24 +- doc/css/boostbook.css | 716 ++++++++++++++++++++++++++++++++++++++ doc/current_function.adoc | 1 + doc/index.adoc | 15 + 6 files changed, 826 insertions(+), 8 deletions(-) create mode 100644 doc/Jamfile create mode 100644 doc/asciidoctor.jam create mode 100644 doc/css/boostbook.css diff --git a/doc/Jamfile b/doc/Jamfile new file mode 100644 index 0000000..a17f865 --- /dev/null +++ b/doc/Jamfile @@ -0,0 +1,54 @@ +# Copyright 2017 Peter Dimov +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +project doc/assert ; + +import asciidoctor ; +import boostbook ; + +# html assert.html : index.adoc : current_function.adoc assert.adoc ; + +boostbook assert.html + : + index.adoc + : + current_function.adoc + assert.adoc + + onehtml + + boost.root=../../../.. + + # File name of HTML output: + root.filename=assert + + # How far down we chunk nested sections, basically all of them: + chunk.section.depth=0 + + # Don't put the first section on the same page as the TOC: + chunk.first.sections=0 + + # How far down sections get TOC's + toc.section.depth=3 + + # Max depth in each TOC: + toc.max.depth=3 + + # How far down we go with TOC's + generate.section.toc.level=0 + + generate.manifest=0 + + html.stylesheet=../css/boostbook.css + ; + +install assert_ : assert.html : html ; + +############################################################################### +alias boostdoc ; +explicit boostdoc ; +alias boostrelease : assert_ ; +explicit boostrelease ; diff --git a/doc/asciidoctor.jam b/doc/asciidoctor.jam new file mode 100644 index 0000000..d90234c --- /dev/null +++ b/doc/asciidoctor.jam @@ -0,0 +1,24 @@ +# Copyright 2017 Peter Dimov +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import generators ; +import type ; +import boostbook ; + +type.register ASCIIDOC : asciidoc adoc ; + +# generators.register-standard asciidoctor.asciidoc2html : ASCIIDOC : HTML ; +generators.register-standard asciidoctor.asciidoc2docbook : ASCIIDOC : DOCBOOK ; + +actions asciidoc2html +{ + asciidoctor -b html -o $(1) $(2) +} + +actions asciidoc2docbook +{ + asciidoctor -b docbook -o $(1) $(2) +} diff --git a/doc/assert.adoc b/doc/assert.adoc index 060291f..ac7c6bf 100644 --- a/doc/assert.adoc +++ b/doc/assert.adoc @@ -12,6 +12,7 @@ http://www.boost.org/LICENSE_1_0.txt # boost/assert.hpp :toc: :toc-title: +:idprefix: ## BOOST_ASSERT @@ -28,23 +29,27 @@ code. affecting the definition of the standard `assert`. * If the macro `BOOST_ENABLE_ASSERT_HANDLER` is defined when `` - is included, `BOOST_ASSERT(expr)` expands to +is included, `BOOST_ASSERT(expr)` expands to ++ ``` (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) ``` -That is, it evaluates `expr` and if it's false, calls `::boost::assertion_failed(#expr, <>, \\__FILE__, \\__LINE__)`. ++ +That is, it evaluates `expr` and if it's false, calls +`::boost::assertion_failed(#expr, <>, \\__FILE__, \\__LINE__)`. This is true regardless of whether `NDEBUG` is defined. - ++ `boost::assertion_failed` is declared in `` as ++ ``` namespace boost { void assertion_failed(char const * expr, char const * function, char const * file, long line); } ``` -but it is never defined. The user is expected to supply an appropriate -definition. ++ +but it is never defined. The user is expected to supply an appropriate definition. * If the macro `BOOST_ENABLE_ASSERT_DEBUG_HANDLER` is defined when `` is included, `BOOST_ASSERT(expr)` expands to `((void)0)` when `NDEBUG` is @@ -67,13 +72,16 @@ the macro `NDEBUG` is defined. * If the macro `BOOST_ENABLE_ASSERT_HANDLER` is defined when `` is included, `BOOST_ASSERT_MSG(expr,msg)` expands to ++ ``` (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) ``` ++ This is true regardless of whether `NDEBUG` is defined. - ++ `boost::assertion_failed_msg` is declared in `` as ++ ``` namespace boost { @@ -81,8 +89,8 @@ namespace boost char const * file, long line); } ``` -but it is never defined. The user is expected to supply an appropriate -definition. ++ +but it is never defined. The user is expected to supply an appropriate definition. * If the macro `BOOST_ENABLE_ASSERT_DEBUG_HANDLER` is defined when `` is included, `BOOST_ASSERT_MSG(expr)` expands to `((void)0)` when `NDEBUG` is diff --git a/doc/css/boostbook.css b/doc/css/boostbook.css new file mode 100644 index 0000000..28f8935 --- /dev/null +++ b/doc/css/boostbook.css @@ -0,0 +1,716 @@ + +/*============================================================================= +Copyright (c) 2004 Joel de Guzman +http://spirit.sourceforge.net/ + +Copyright 2013 Niall Douglas additions for colors and alignment. +Copyright 2013 Paul A. Bristow additions for more colors and alignments. + +Distributed under the Boost Software License, Version 1.0. (See accompany- +ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +/*============================================================================= +Body defaults +=============================================================================*/ + + body + { + margin: 1em; + font-family: sans-serif; + } + +/*============================================================================= +Paragraphs +=============================================================================*/ + + p + { + text-align: left; + font-size: 10pt; + line-height: 1.15; + } + +/*============================================================================= +Program listings +=============================================================================*/ + + /* Code on paragraphs */ + p tt.computeroutput + { + font-size: 9pt; + } + + pre.synopsis + { + font-size: 9pt; + margin: 1pc 4% 0pc 4%; + padding: 0.5pc 0.5pc 0.5pc 0.5pc; + } + + .programlisting, + .screen + { + font-size: 9pt; + display: block; + margin: 1pc 4% 0pc 4%; + padding: 0.5pc 0.5pc 0.5pc 0.5pc; + } + + /* Program listings in tables don't get borders */ + td .programlisting, + td .screen + { + margin: 0pc 0pc 0pc 0pc; + padding: 0pc 0pc 0pc 0pc; + } + +/*============================================================================= +Headings +=============================================================================*/ + + h1, h2, h3, h4, h5, h6 + { + text-align: left; + margin: 1em 0em 0.5em 0em; + font-weight: bold; + } + + h1 { font-size: 140%; } + h2 { font-weight: bold; font-size: 140%; } + h3 { font-weight: bold; font-size: 130%; } + h4 { font-weight: bold; font-size: 120%; } + h5 { font-weight: normal; font-style: italic; font-size: 110%; } + h6 { font-weight: normal; font-style: italic; font-size: 100%; } + + /* Top page titles */ + title, + h1.title, + h2.title + h3.title, + h4.title, + h5.title, + h6.title, + .refentrytitle + { + font-weight: bold; + margin-bottom: 1pc; + } + + h1.title { font-size: 140% } + h2.title { font-size: 140% } + h3.title { font-size: 130% } + h4.title { font-size: 120% } + h5.title { font-size: 110% } + h6.title { font-size: 100% } + + .section h1 + { + margin: 0em 0em 0.5em 0em; + font-size: 140%; + } + + .section h2 { font-size: 140% } + .section h3 { font-size: 130% } + .section h4 { font-size: 120% } + .section h5 { font-size: 110% } + .section h6 { font-size: 100% } + + /* Code on titles */ + h1 tt.computeroutput { font-size: 140% } + h2 tt.computeroutput { font-size: 140% } + h3 tt.computeroutput { font-size: 130% } + h4 tt.computeroutput { font-size: 130% } + h5 tt.computeroutput { font-size: 130% } + h6 tt.computeroutput { font-size: 130% } + + +/*============================================================================= +Author +=============================================================================*/ + + h3.author + { + font-size: 100% + } + +/*============================================================================= +Lists +=============================================================================*/ + + li + { + font-size: 10pt; + line-height: 1.3; + } + + /* Unordered lists */ + ul + { + text-align: left; + } + + /* Ordered lists */ + ol + { + text-align: left; + } + +/*============================================================================= +Links +=============================================================================*/ + + a + { + text-decoration: none; /* no underline */ + } + + a:hover + { + text-decoration: underline; + } + +/*============================================================================= +Spirit style navigation +=============================================================================*/ + + .spirit-nav + { + text-align: right; + } + + .spirit-nav a + { + color: white; + padding-left: 0.5em; + } + + .spirit-nav img + { + border-width: 0px; + } + +/*============================================================================= +Copyright footer +=============================================================================*/ + .copyright-footer + { + text-align: right; + font-size: 70%; + } + + .copyright-footer p + { + text-align: right; + font-size: 80%; + } + +/*============================================================================= +Table of contents +=============================================================================*/ + + div.toc + { + margin: 1pc 4% 0pc 4%; + padding: 0.1pc 1pc 0.1pc 1pc; + font-size: 80%; + line-height: 1.15; + } + + .boost-toc + { + float: right; + padding: 0.5pc; + } + + /* Code on toc */ + .toc .computeroutput { font-size: 120% } + + /* No margin on nested menus */ + + .toc dl dl { margin: 0; } + +/*============================================================================= +Tables +=============================================================================*/ + + .table-title, + div.table p.title + { + margin-left: 4%; + padding-right: 0.5em; + padding-left: 0.5em; + } + + .informaltable table, + .table table + { + width: 92%; + margin-left: 4%; + margin-right: 4%; + } + + div.informaltable table, + div.table table + { + padding: 4px; + } + + /* Table Cells */ + div.informaltable table tr td, + div.table table tr td + { + padding: 0.5em; + text-align: left; + font-size: 9pt; + } + + div.informaltable table tr th, + div.table table tr th + { + padding: 0.5em 0.5em 0.5em 0.5em; + border: 1pt solid white; + font-size: 80%; + } + + table.simplelist + { + width: auto !important; + margin: 0em !important; + padding: 0em !important; + border: none !important; + } + table.simplelist td + { + margin: 0em !important; + padding: 0em !important; + text-align: left !important; + font-size: 9pt !important; + border: none !important; + } + +/*============================================================================= +Suppress margins in tables +=============================================================================*/ + + table th > *:first-child, + table td > *:first-child + { + margin-top: 0; + } + + table th > *:last-child, + table td > *:last-child + { + margin-bottom: 0; + } + +/*============================================================================= +Blurbs +=============================================================================*/ + + div.note, + div.tip, + div.important, + div.caution, + div.warning, + p.blurb + { + font-size: 9pt; /* A little bit smaller than the main text */ + line-height: 1.2; + display: block; + margin: 1pc 4% 0pc 4%; + padding: 0.5pc 0.5pc 0.5pc 0.5pc; + } + + p.blurb img + { + padding: 1pt; + } + +/*============================================================================= +Variable Lists +=============================================================================*/ + + div.variablelist + { + margin: 1em 0; + } + + /* Make the terms in definition lists bold */ + div.variablelist dl dt, + span.term + { + font-weight: bold; + font-size: 10pt; + } + + div.variablelist table tbody tr td + { + text-align: left; + vertical-align: top; + padding: 0em 2em 0em 0em; + font-size: 10pt; + margin: 0em 0em 0.5em 0em; + line-height: 1; + } + + div.variablelist dl dt + { + margin-bottom: 0.2em; + } + + div.variablelist dl dd + { + margin: 0em 0em 0.5em 2em; + font-size: 10pt; + } + + div.variablelist table tbody tr td p, + div.variablelist dl dd p + { + margin: 0em 0em 0.5em 0em; + line-height: 1; + } + +/*============================================================================= +Misc +=============================================================================*/ + + /* Title of books and articles in bibliographies */ + span.title + { + font-style: italic; + } + + span.underline + { + text-decoration: underline; + } + + span.strikethrough + { + text-decoration: line-through; + } + + /* Copyright, Legal Notice */ + div div.legalnotice p + { + text-align: left + } + +/*============================================================================= +Colors +=============================================================================*/ + + @media screen + { + body { + background-color: #FFFFFF; + color: #000000; + } + + /* Syntax Highlighting */ + .keyword { color: #0000AA; } + .identifier { color: #000000; } + .special { color: #707070; } + .preprocessor { color: #402080; } + .char { color: teal; } + .comment { color: #800000; } + .string { color: teal; } + .number { color: teal; } + .white_bkd { background-color: #FFFFFF; } + .dk_grey_bkd { background-color: #999999; } + + /* Links */ + a, a .keyword, a .identifier, a .special, a .preprocessor + a .char, a .comment, a .string, a .number + { + color: #005a9c; + } + + a:visited, a:visited .keyword, a:visited .identifier, + a:visited .special, a:visited .preprocessor a:visited .char, + a:visited .comment, a:visited .string, a:visited .number + { + color: #9c5a9c; + } + + h1 a, h2 a, h3 a, h4 a, h5 a, h6 a, + h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover, + h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited + { + text-decoration: none; /* no underline */ + color: #000000; + } + + /* Copyright, Legal Notice */ + .copyright + { + color: #666666; + font-size: small; + } + + div div.legalnotice p + { + color: #666666; + } + + /* Program listing */ + pre.synopsis + { + border: 1px solid #DCDCDC; + } + + .programlisting, + .screen + { + border: 1px solid #DCDCDC; + } + + td .programlisting, + td .screen + { + border: 0px solid #DCDCDC; + } + + /* Blurbs */ + div.note, + div.tip, + div.important, + div.caution, + div.warning, + p.blurb + { + border: 1px solid #DCDCDC; + } + + /* Table of contents */ + div.toc + { + border: 1px solid #DCDCDC; + } + + /* Tables */ + div.informaltable table tr td, + div.table table tr td + { + border: 1px solid #DCDCDC; + } + + div.informaltable table tr th, + div.table table tr th + { + background-color: #F0F0F0; + border: 1px solid #DCDCDC; + } + + .copyright-footer + { + color: #8F8F8F; + } + + /* Misc */ + span.highlight + { + color: #00A000; + } + } + + @media print + { + /* Links */ + a + { + color: black; + } + + a:visited + { + color: black; + } + + .spirit-nav + { + display: none; + } + + /* Program listing */ + pre.synopsis + { + border: 1px solid gray; + } + + .programlisting, + .screen + { + border: 1px solid gray; + } + + td .programlisting, + td .screen + { + border: 0px solid #DCDCDC; + } + + /* Table of contents */ + div.toc + { + border: 1px solid gray; + } + + .informaltable table, + .table table + { + border: 1px solid gray; + border-collapse: collapse; + } + + /* Tables */ + div.informaltable table tr td, + div.table table tr td + { + border: 1px solid gray; + } + + div.informaltable table tr th, + div.table table tr th + { + border: 1px solid gray; + } + + table.simplelist tr td + { + border: none !important; + } + + /* Misc */ + span.highlight + { + font-weight: bold; + } + } + +/*============================================================================= +Images +=============================================================================*/ + + span.inlinemediaobject img + { + vertical-align: middle; + } + +/*============================================================================== +Super and Subscript: style so that line spacing isn't effected, see +http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=1&postId=5341 +==============================================================================*/ + +sup, +sub { +height: 0; +line-height: 1; +vertical-align: baseline; +position: relative; + +} + +/* For internet explorer: */ + +* html sup, +* html sub { +vertical-align: bottom; +} + +sup { +bottom: 1ex; +} + +sub { +top: .5ex; +} + +/*============================================================================== +Indexes: pretty much the same as the TOC. +==============================================================================*/ + + .index + { + font-size: 80%; + padding-top: 0px; + padding-bottom: 0px; + margin-top: 0px; + margin-bottom: 0px; + margin-left: 0px; + } + + .index ul + { + padding-left: 3em; + } + + .index p + { + padding: 2px; + margin: 2px; + } + + .index-entry-level-0 + { + font-weight: bold; + } + + .index em + { + font-weight: bold; + } + + +/*============================================================================== +Alignment and coloring use 'role' feature, available from Quickbook 1.6 up. +Added from Niall Douglas for role color and alignment. +http://article.gmane.org/gmane.comp.lib.boost.devel/243318 +*/ + +/* Add text alignment (see http://www.w3schools.com/cssref/pr_text_text-align.asp) */ +span.aligncenter +{ + display: inline-block; width: 100%; text-align: center; +} +span.alignright +{ + display: inline-block; width: 100%; text-align: right; +} +/* alignleft is the default. */ +span.alignleft +{ + display: inline-block; width: 100%; text-align: left; +} + +/* alignjustify stretches the word spacing so that each line has equal width +within a chosen fraction of page width (here arbitrarily 20%). +*Not* useful inside table items as the column width remains the total string width. +Nor very useful, except to temporarily restrict the width. +*/ +span.alignjustify +{ + display: inline-block; width: 20%; text-align: justify; +} + +/* Text colors. +Names at http://www.w3.org/TR/2002/WD-css3-color-20020219/ 4.3. X11 color keywords. +Quickbook Usage: [role red Some red text] + +*/ +span.red { inline-block; color: red; } +span.green { color: green; } +span.lime { color: #00FF00; } +span.blue { color: blue; } +span.navy { color: navy; } +span.yellow { color: yellow; } +span.magenta { color: magenta; } +span.indigo { color: #4B0082; } +span.cyan { color: cyan; } +span.purple { color: purple; } +span.gold { color: gold; } +span.silver { color: silver; } /* lighter gray */ +span.gray { color: #808080; } /* light gray */ diff --git a/doc/current_function.adoc b/doc/current_function.adoc index 9c96170..1151af1 100644 --- a/doc/current_function.adoc +++ b/doc/current_function.adoc @@ -10,6 +10,7 @@ http://www.boost.org/LICENSE_1_0.txt # boost/current_function.hpp :toc: :toc-title: +:idprefix: ## BOOST_CURRENT_FUNCTION diff --git a/doc/index.adoc b/doc/index.adoc index 7d3915e..172930a 100644 --- a/doc/index.adoc +++ b/doc/index.adoc @@ -8,11 +8,26 @@ http://www.boost.org/LICENSE_1_0.txt //// # Boost.Assert +Peter Dimov :toc: +:idprefix: The Boost.Assert library provides several configurable diagnostic macros similar in behavior and purpose to the standard macro `assert` from ``. +:leveloffset: +1 + include::assert.adoc[] include::current_function.adoc[] + +:leveloffset: -1 + +[appendix] +## Copyright and License + +* Copyright 2002, 2007, 2014, 2017 Peter Dimov +* Copyright 2011 Beman Dawes +* Copyright 2015 Ion Gaztanaga + +Distributed under the http://www.boost.org/LICENSE_1_0.txt[Boost Software License, Version 1.0]. From 0f5872df80c386460ad5a93b9ebf7eda030510d9 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 6 Jun 2017 03:46:51 +0300 Subject: [PATCH 12/22] Update docs, update Jamfiles to not use DocBook --- doc/Jamfile | 43 +-- doc/asciidoctor.jam | 25 +- doc/assert.adoc | 2 +- doc/css/boostbook.css | 716 -------------------------------------- doc/current_function.adoc | 2 +- 5 files changed, 30 insertions(+), 758 deletions(-) delete mode 100644 doc/css/boostbook.css diff --git a/doc/Jamfile b/doc/Jamfile index a17f865..164a562 100644 --- a/doc/Jamfile +++ b/doc/Jamfile @@ -7,48 +7,17 @@ project doc/assert ; import asciidoctor ; -import boostbook ; +# import boostbook ; -# html assert.html : index.adoc : current_function.adoc assert.adoc ; +html assert.html : index.adoc ; -boostbook assert.html - : - index.adoc - : - current_function.adoc - assert.adoc - - onehtml +# docbook assert.docbook : index.adoc ; +# boostbook assert.html : assert.docbook : onehtml ; - boost.root=../../../.. - - # File name of HTML output: - root.filename=assert - - # How far down we chunk nested sections, basically all of them: - chunk.section.depth=0 - - # Don't put the first section on the same page as the TOC: - chunk.first.sections=0 - - # How far down sections get TOC's - toc.section.depth=3 - - # Max depth in each TOC: - toc.max.depth=3 - - # How far down we go with TOC's - generate.section.toc.level=0 - - generate.manifest=0 - - html.stylesheet=../css/boostbook.css - ; - -install assert_ : assert.html : html ; +install assert_html : assert.html : html ; ############################################################################### alias boostdoc ; explicit boostdoc ; -alias boostrelease : assert_ ; +alias boostrelease : assert_html ; explicit boostrelease ; diff --git a/doc/asciidoctor.jam b/doc/asciidoctor.jam index d90234c..5988cd4 100644 --- a/doc/asciidoctor.jam +++ b/doc/asciidoctor.jam @@ -4,14 +4,33 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -import generators ; import type ; +import scanner ; +import generators ; import boostbook ; +# File type type.register ASCIIDOC : asciidoc adoc ; -# generators.register-standard asciidoctor.asciidoc2html : ASCIIDOC : HTML ; -generators.register-standard asciidoctor.asciidoc2docbook : ASCIIDOC : DOCBOOK ; +# Define dependency scanner + +class asciidoc-scanner : common-scanner +{ + rule pattern ( ) + { + return "include::([^[]+)\\[" ; + } +} + +scanner.register asciidoc-scanner : include ; +type.set-scanner ASCIIDOC : asciidoc-scanner ; + +# Define generators + +generators.register-standard asciidoctor.asciidoc2html : ASCIIDOC : HTML ; +# generators.register-standard asciidoctor.asciidoc2docbook : ASCIIDOC : DOCBOOK ; + +# Define actions actions asciidoc2html { diff --git a/doc/assert.adoc b/doc/assert.adoc index ac7c6bf..b158ab6 100644 --- a/doc/assert.adoc +++ b/doc/assert.adoc @@ -9,7 +9,7 @@ See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt //// -# boost/assert.hpp +# Assertion Macros, :toc: :toc-title: :idprefix: diff --git a/doc/css/boostbook.css b/doc/css/boostbook.css deleted file mode 100644 index 28f8935..0000000 --- a/doc/css/boostbook.css +++ /dev/null @@ -1,716 +0,0 @@ - -/*============================================================================= -Copyright (c) 2004 Joel de Guzman -http://spirit.sourceforge.net/ - -Copyright 2013 Niall Douglas additions for colors and alignment. -Copyright 2013 Paul A. Bristow additions for more colors and alignments. - -Distributed under the Boost Software License, Version 1.0. (See accompany- -ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ - -/*============================================================================= -Body defaults -=============================================================================*/ - - body - { - margin: 1em; - font-family: sans-serif; - } - -/*============================================================================= -Paragraphs -=============================================================================*/ - - p - { - text-align: left; - font-size: 10pt; - line-height: 1.15; - } - -/*============================================================================= -Program listings -=============================================================================*/ - - /* Code on paragraphs */ - p tt.computeroutput - { - font-size: 9pt; - } - - pre.synopsis - { - font-size: 9pt; - margin: 1pc 4% 0pc 4%; - padding: 0.5pc 0.5pc 0.5pc 0.5pc; - } - - .programlisting, - .screen - { - font-size: 9pt; - display: block; - margin: 1pc 4% 0pc 4%; - padding: 0.5pc 0.5pc 0.5pc 0.5pc; - } - - /* Program listings in tables don't get borders */ - td .programlisting, - td .screen - { - margin: 0pc 0pc 0pc 0pc; - padding: 0pc 0pc 0pc 0pc; - } - -/*============================================================================= -Headings -=============================================================================*/ - - h1, h2, h3, h4, h5, h6 - { - text-align: left; - margin: 1em 0em 0.5em 0em; - font-weight: bold; - } - - h1 { font-size: 140%; } - h2 { font-weight: bold; font-size: 140%; } - h3 { font-weight: bold; font-size: 130%; } - h4 { font-weight: bold; font-size: 120%; } - h5 { font-weight: normal; font-style: italic; font-size: 110%; } - h6 { font-weight: normal; font-style: italic; font-size: 100%; } - - /* Top page titles */ - title, - h1.title, - h2.title - h3.title, - h4.title, - h5.title, - h6.title, - .refentrytitle - { - font-weight: bold; - margin-bottom: 1pc; - } - - h1.title { font-size: 140% } - h2.title { font-size: 140% } - h3.title { font-size: 130% } - h4.title { font-size: 120% } - h5.title { font-size: 110% } - h6.title { font-size: 100% } - - .section h1 - { - margin: 0em 0em 0.5em 0em; - font-size: 140%; - } - - .section h2 { font-size: 140% } - .section h3 { font-size: 130% } - .section h4 { font-size: 120% } - .section h5 { font-size: 110% } - .section h6 { font-size: 100% } - - /* Code on titles */ - h1 tt.computeroutput { font-size: 140% } - h2 tt.computeroutput { font-size: 140% } - h3 tt.computeroutput { font-size: 130% } - h4 tt.computeroutput { font-size: 130% } - h5 tt.computeroutput { font-size: 130% } - h6 tt.computeroutput { font-size: 130% } - - -/*============================================================================= -Author -=============================================================================*/ - - h3.author - { - font-size: 100% - } - -/*============================================================================= -Lists -=============================================================================*/ - - li - { - font-size: 10pt; - line-height: 1.3; - } - - /* Unordered lists */ - ul - { - text-align: left; - } - - /* Ordered lists */ - ol - { - text-align: left; - } - -/*============================================================================= -Links -=============================================================================*/ - - a - { - text-decoration: none; /* no underline */ - } - - a:hover - { - text-decoration: underline; - } - -/*============================================================================= -Spirit style navigation -=============================================================================*/ - - .spirit-nav - { - text-align: right; - } - - .spirit-nav a - { - color: white; - padding-left: 0.5em; - } - - .spirit-nav img - { - border-width: 0px; - } - -/*============================================================================= -Copyright footer -=============================================================================*/ - .copyright-footer - { - text-align: right; - font-size: 70%; - } - - .copyright-footer p - { - text-align: right; - font-size: 80%; - } - -/*============================================================================= -Table of contents -=============================================================================*/ - - div.toc - { - margin: 1pc 4% 0pc 4%; - padding: 0.1pc 1pc 0.1pc 1pc; - font-size: 80%; - line-height: 1.15; - } - - .boost-toc - { - float: right; - padding: 0.5pc; - } - - /* Code on toc */ - .toc .computeroutput { font-size: 120% } - - /* No margin on nested menus */ - - .toc dl dl { margin: 0; } - -/*============================================================================= -Tables -=============================================================================*/ - - .table-title, - div.table p.title - { - margin-left: 4%; - padding-right: 0.5em; - padding-left: 0.5em; - } - - .informaltable table, - .table table - { - width: 92%; - margin-left: 4%; - margin-right: 4%; - } - - div.informaltable table, - div.table table - { - padding: 4px; - } - - /* Table Cells */ - div.informaltable table tr td, - div.table table tr td - { - padding: 0.5em; - text-align: left; - font-size: 9pt; - } - - div.informaltable table tr th, - div.table table tr th - { - padding: 0.5em 0.5em 0.5em 0.5em; - border: 1pt solid white; - font-size: 80%; - } - - table.simplelist - { - width: auto !important; - margin: 0em !important; - padding: 0em !important; - border: none !important; - } - table.simplelist td - { - margin: 0em !important; - padding: 0em !important; - text-align: left !important; - font-size: 9pt !important; - border: none !important; - } - -/*============================================================================= -Suppress margins in tables -=============================================================================*/ - - table th > *:first-child, - table td > *:first-child - { - margin-top: 0; - } - - table th > *:last-child, - table td > *:last-child - { - margin-bottom: 0; - } - -/*============================================================================= -Blurbs -=============================================================================*/ - - div.note, - div.tip, - div.important, - div.caution, - div.warning, - p.blurb - { - font-size: 9pt; /* A little bit smaller than the main text */ - line-height: 1.2; - display: block; - margin: 1pc 4% 0pc 4%; - padding: 0.5pc 0.5pc 0.5pc 0.5pc; - } - - p.blurb img - { - padding: 1pt; - } - -/*============================================================================= -Variable Lists -=============================================================================*/ - - div.variablelist - { - margin: 1em 0; - } - - /* Make the terms in definition lists bold */ - div.variablelist dl dt, - span.term - { - font-weight: bold; - font-size: 10pt; - } - - div.variablelist table tbody tr td - { - text-align: left; - vertical-align: top; - padding: 0em 2em 0em 0em; - font-size: 10pt; - margin: 0em 0em 0.5em 0em; - line-height: 1; - } - - div.variablelist dl dt - { - margin-bottom: 0.2em; - } - - div.variablelist dl dd - { - margin: 0em 0em 0.5em 2em; - font-size: 10pt; - } - - div.variablelist table tbody tr td p, - div.variablelist dl dd p - { - margin: 0em 0em 0.5em 0em; - line-height: 1; - } - -/*============================================================================= -Misc -=============================================================================*/ - - /* Title of books and articles in bibliographies */ - span.title - { - font-style: italic; - } - - span.underline - { - text-decoration: underline; - } - - span.strikethrough - { - text-decoration: line-through; - } - - /* Copyright, Legal Notice */ - div div.legalnotice p - { - text-align: left - } - -/*============================================================================= -Colors -=============================================================================*/ - - @media screen - { - body { - background-color: #FFFFFF; - color: #000000; - } - - /* Syntax Highlighting */ - .keyword { color: #0000AA; } - .identifier { color: #000000; } - .special { color: #707070; } - .preprocessor { color: #402080; } - .char { color: teal; } - .comment { color: #800000; } - .string { color: teal; } - .number { color: teal; } - .white_bkd { background-color: #FFFFFF; } - .dk_grey_bkd { background-color: #999999; } - - /* Links */ - a, a .keyword, a .identifier, a .special, a .preprocessor - a .char, a .comment, a .string, a .number - { - color: #005a9c; - } - - a:visited, a:visited .keyword, a:visited .identifier, - a:visited .special, a:visited .preprocessor a:visited .char, - a:visited .comment, a:visited .string, a:visited .number - { - color: #9c5a9c; - } - - h1 a, h2 a, h3 a, h4 a, h5 a, h6 a, - h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover, - h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited - { - text-decoration: none; /* no underline */ - color: #000000; - } - - /* Copyright, Legal Notice */ - .copyright - { - color: #666666; - font-size: small; - } - - div div.legalnotice p - { - color: #666666; - } - - /* Program listing */ - pre.synopsis - { - border: 1px solid #DCDCDC; - } - - .programlisting, - .screen - { - border: 1px solid #DCDCDC; - } - - td .programlisting, - td .screen - { - border: 0px solid #DCDCDC; - } - - /* Blurbs */ - div.note, - div.tip, - div.important, - div.caution, - div.warning, - p.blurb - { - border: 1px solid #DCDCDC; - } - - /* Table of contents */ - div.toc - { - border: 1px solid #DCDCDC; - } - - /* Tables */ - div.informaltable table tr td, - div.table table tr td - { - border: 1px solid #DCDCDC; - } - - div.informaltable table tr th, - div.table table tr th - { - background-color: #F0F0F0; - border: 1px solid #DCDCDC; - } - - .copyright-footer - { - color: #8F8F8F; - } - - /* Misc */ - span.highlight - { - color: #00A000; - } - } - - @media print - { - /* Links */ - a - { - color: black; - } - - a:visited - { - color: black; - } - - .spirit-nav - { - display: none; - } - - /* Program listing */ - pre.synopsis - { - border: 1px solid gray; - } - - .programlisting, - .screen - { - border: 1px solid gray; - } - - td .programlisting, - td .screen - { - border: 0px solid #DCDCDC; - } - - /* Table of contents */ - div.toc - { - border: 1px solid gray; - } - - .informaltable table, - .table table - { - border: 1px solid gray; - border-collapse: collapse; - } - - /* Tables */ - div.informaltable table tr td, - div.table table tr td - { - border: 1px solid gray; - } - - div.informaltable table tr th, - div.table table tr th - { - border: 1px solid gray; - } - - table.simplelist tr td - { - border: none !important; - } - - /* Misc */ - span.highlight - { - font-weight: bold; - } - } - -/*============================================================================= -Images -=============================================================================*/ - - span.inlinemediaobject img - { - vertical-align: middle; - } - -/*============================================================================== -Super and Subscript: style so that line spacing isn't effected, see -http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=1&postId=5341 -==============================================================================*/ - -sup, -sub { -height: 0; -line-height: 1; -vertical-align: baseline; -position: relative; - -} - -/* For internet explorer: */ - -* html sup, -* html sub { -vertical-align: bottom; -} - -sup { -bottom: 1ex; -} - -sub { -top: .5ex; -} - -/*============================================================================== -Indexes: pretty much the same as the TOC. -==============================================================================*/ - - .index - { - font-size: 80%; - padding-top: 0px; - padding-bottom: 0px; - margin-top: 0px; - margin-bottom: 0px; - margin-left: 0px; - } - - .index ul - { - padding-left: 3em; - } - - .index p - { - padding: 2px; - margin: 2px; - } - - .index-entry-level-0 - { - font-weight: bold; - } - - .index em - { - font-weight: bold; - } - - -/*============================================================================== -Alignment and coloring use 'role' feature, available from Quickbook 1.6 up. -Added from Niall Douglas for role color and alignment. -http://article.gmane.org/gmane.comp.lib.boost.devel/243318 -*/ - -/* Add text alignment (see http://www.w3schools.com/cssref/pr_text_text-align.asp) */ -span.aligncenter -{ - display: inline-block; width: 100%; text-align: center; -} -span.alignright -{ - display: inline-block; width: 100%; text-align: right; -} -/* alignleft is the default. */ -span.alignleft -{ - display: inline-block; width: 100%; text-align: left; -} - -/* alignjustify stretches the word spacing so that each line has equal width -within a chosen fraction of page width (here arbitrarily 20%). -*Not* useful inside table items as the column width remains the total string width. -Nor very useful, except to temporarily restrict the width. -*/ -span.alignjustify -{ - display: inline-block; width: 20%; text-align: justify; -} - -/* Text colors. -Names at http://www.w3.org/TR/2002/WD-css3-color-20020219/ 4.3. X11 color keywords. -Quickbook Usage: [role red Some red text] - -*/ -span.red { inline-block; color: red; } -span.green { color: green; } -span.lime { color: #00FF00; } -span.blue { color: blue; } -span.navy { color: navy; } -span.yellow { color: yellow; } -span.magenta { color: magenta; } -span.indigo { color: #4B0082; } -span.cyan { color: cyan; } -span.purple { color: purple; } -span.gold { color: gold; } -span.silver { color: silver; } /* lighter gray */ -span.gray { color: #808080; } /* light gray */ diff --git a/doc/current_function.adoc b/doc/current_function.adoc index 1151af1..9235c1a 100644 --- a/doc/current_function.adoc +++ b/doc/current_function.adoc @@ -7,7 +7,7 @@ See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt //// -# boost/current_function.hpp +# Current Function Macro, :toc: :toc-title: :idprefix: From ed9df5994bec0c13497a8c59cb811a5022371d66 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 6 Jun 2017 04:28:01 +0300 Subject: [PATCH 13/22] Move ToC to the left --- doc/index.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/index.adoc b/doc/index.adoc index 172930a..5dfda6b 100644 --- a/doc/index.adoc +++ b/doc/index.adoc @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt # Boost.Assert Peter Dimov -:toc: +:toc: left :idprefix: The Boost.Assert library provides several configurable diagnostic macros From 618f5c72e7a3854bdd17233371278c95961ce024 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 6 Jun 2017 04:28:34 +0300 Subject: [PATCH 14/22] Add html --- doc/html/assert.html | 731 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 731 insertions(+) create mode 100644 doc/html/assert.html diff --git a/doc/html/assert.html b/doc/html/assert.html new file mode 100644 index 0000000..c771594 --- /dev/null +++ b/doc/html/assert.html @@ -0,0 +1,731 @@ + + + + + + + + +Boost.Assert + + + + + +
+
+
+
+

The Boost.Assert library provides several configurable diagnostic macros +similar in behavior and purpose to the standard macro assert from <cassert>.

+
+
+
+
+

Assertion Macros, <boost/assert.hpp>

+
+
+

BOOST_ASSERT

+
+

The header <boost/assert.hpp> defines the macro BOOST_ASSERT, +which is similar to the standard assert macro defined in <cassert>. +The macro is intended to be used in both Boost libraries and user +code.

+
+
+
    +
  • +

    By default, BOOST_ASSERT(expr) expands to assert(expr).

    +
  • +
  • +

    If the macro BOOST_DISABLE_ASSERTS is defined when <boost/assert.hpp> +is included, BOOST_ASSERT(expr) expands to ((void)0), regardless of whether +the macro NDEBUG is defined. This allows users to selectively disable BOOST_ASSERT without +affecting the definition of the standard assert.

    +
  • +
  • +

    If the macro BOOST_ENABLE_ASSERT_HANDLER is defined when <boost/assert.hpp> +is included, BOOST_ASSERT(expr) expands to

    +
    +
    +
    (BOOST_LIKELY(!!(expr))? ((void)0):
    +    ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
    +
    +
    +
    +

    That is, it evaluates expr and if it’s false, calls +::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__). +This is true regardless of whether NDEBUG is defined.

    +
    +
    +

    boost::assertion_failed is declared in <boost/assert.hpp> as

    +
    +
    +
    +
    namespace boost
    +{
    +    void assertion_failed(char const * expr, char const * function, char const * file, long line);
    +}
    +
    +
    +
    +

    but it is never defined. The user is expected to supply an appropriate definition.

    +
    +
  • +
  • +

    If the macro BOOST_ENABLE_ASSERT_DEBUG_HANDLER is defined when <boost/assert.hpp> +is included, BOOST_ASSERT(expr) expands to ((void)0) when NDEBUG is +defined. Otherwise the behavior is as if BOOST_ENABLE_ASSERT_HANDLER has been defined.

    +
  • +
+
+
+

As is the case with <cassert>, <boost/assert.hpp> +can be included multiple times in a single translation unit. BOOST_ASSERT +will be redefined each time as specified above.

+
+
+
+

BOOST_ASSERT_MSG

+
+

The macro BOOST_ASSERT_MSG is similar to BOOST_ASSERT, but it takes an additional argument, +a character literal, supplying an error message.

+
+
+
    +
  • +

    By default, BOOST_ASSERT_MSG(expr,msg) expands to assert((expr)&&(msg)).

    +
  • +
  • +

    If the macro BOOST_DISABLE_ASSERTS is defined when <boost/assert.hpp> +is included, BOOST_ASSERT_MSG(expr,msg) expands to ((void)0), regardless of whether +the macro NDEBUG is defined.

    +
  • +
  • +

    If the macro BOOST_ENABLE_ASSERT_HANDLER is defined when <boost/assert.hpp> +is included, BOOST_ASSERT_MSG(expr,msg) expands to

    +
    +
    +
    (BOOST_LIKELY(!!(expr))? ((void)0):
    +    ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
    +
    +
    +
    +

    This is true regardless of whether NDEBUG is defined.

    +
    +
    +

    boost::assertion_failed_msg is declared in <boost/assert.hpp> as

    +
    +
    +
    +
    namespace boost
    +{
    +    void assertion_failed_msg(char const * expr, char const * msg, char const * function,
    +        char const * file, long line);
    +}
    +
    +
    +
    +

    but it is never defined. The user is expected to supply an appropriate definition.

    +
    +
  • +
  • +

    If the macro BOOST_ENABLE_ASSERT_DEBUG_HANDLER is defined when <boost/assert.hpp> +is included, BOOST_ASSERT_MSG(expr) expands to ((void)0) when NDEBUG is +defined. Otherwise the behavior is as if BOOST_ENABLE_ASSERT_HANDLER has been defined.

    +
  • +
+
+
+

As is the case with <cassert>, <boost/assert.hpp> +can be included multiple times in a single translation unit. BOOST_ASSERT_MSG +will be redefined each time as specified above.

+
+
+
+

BOOST_VERIFY

+
+

The macro BOOST_VERIFY has the same behavior as BOOST_ASSERT, except that +the expression that is passed to BOOST_VERIFY is always +evaluated. This is useful when the asserted expression has desirable side +effects; it can also help suppress warnings about unused variables when the +only use of the variable is inside an assertion.

+
+
+
    +
  • +

    If the macro BOOST_DISABLE_ASSERTS is defined when <boost/assert.hpp> +is included, BOOST_VERIFY(expr) expands to ((void)(expr)).

    +
  • +
  • +

    If the macro BOOST_ENABLE_ASSERT_HANDLER is defined when <boost/assert.hpp> +is included, BOOST_VERIFY(expr) expands to BOOST_ASSERT(expr).

    +
  • +
  • +

    Otherwise, BOOST_VERIFY(expr) expands to ((void)(expr)) when NDEBUG is +defined, to BOOST_ASSERT(expr) when it’s not.

    +
  • +
+
+
+
+

BOOST_VERIFY_MSG

+
+

The macro BOOST_VERIFY_MSG is similar to BOOST_VERIFY, with an additional parameter, an error message.

+
+
+
    +
  • +

    If the macro BOOST_DISABLE_ASSERTS is defined when <boost/assert.hpp> +is included, BOOST_VERIFY_MSG(expr,msg) expands to ((void)(expr)).

    +
  • +
  • +

    If the macro BOOST_ENABLE_ASSERT_HANDLER is defined when <boost/assert.hpp> +is included, BOOST_VERIFY_MSG(expr,msg) expands to BOOST_ASSERT_MSG(expr,msg).

    +
  • +
  • +

    Otherwise, BOOST_VERIFY_MSG(expr,msg) expands to ((void)(expr)) when NDEBUG is +defined, to BOOST_ASSERT_MSG(expr,msg) when it’s not.

    +
  • +
+
+
+
+

BOOST_ASSERT_IS_VOID

+
+

The macro BOOST_ASSERT_IS_VOID is defined when BOOST_ASSERT and BOOST_ASSERT_MSG are expanded to ((void)0). +Its purpose is to avoid compiling and potentially running code that is only intended to prepare data to be used in the assertion.

+
+
+
+
void MyContainer::erase(iterator i)
+{
+// Some sanity checks, data must be ordered
+#ifndef BOOST_ASSERT_IS_VOID
+
+    if(i != c.begin()) {
+        iterator prev = i;
+        --prev;
+        BOOST_ASSERT(*prev < *i);
+    }
+    else if(i != c.end()) {
+        iterator next = i;
+        ++next;
+        BOOST_ASSERT(*i < *next);
+    }
+
+#endif
+
+    this->erase_impl(i);
+}
+
+
+
+
    +
  • +

    By default, BOOST_ASSERT_IS_VOID is defined if NDEBUG is defined.

    +
  • +
  • +

    If the macro BOOST_DISABLE_ASSERTS is defined, BOOST_ASSERT_IS_VOID is always defined.

    +
  • +
  • +

    If the macro BOOST_ENABLE_ASSERT_HANDLER is defined, BOOST_ASSERT_IS_VOID is never defined.

    +
  • +
  • +

    If the macro BOOST_ENABLE_ASSERT_DEBUG_HANDLER is defined, then BOOST_ASSERT_IS_VOID is defined when NDEBUG is defined.

    +
  • +
+
+
+
+
+
+

Current Function Macro, <boost/current_function.hpp>

+
+
+

BOOST_CURRENT_FUNCTION

+
+

The header <boost/current_function.hpp> defines a single macro, BOOST_CURRENT_FUNCTION, +similar to the C99 predefined identifier __func__.

+
+
+

BOOST_CURRENT_FUNCTION expands to a string literal containing +the (fully qualified, if possible) name of the enclosing function. If there is +no enclosing function, the behavior is unspecified.

+
+
+

Some compilers do not provide a way to obtain the name of the current enclosing +function. On such compilers, or when the macro BOOST_DISABLE_CURRENT_FUNCTION +is defined, BOOST_CURRENT_FUNCTION expands to "(unknown)".

+
+
+

BOOST_DISABLE_CURRENT_FUNCTION addresses a use case in which the programmer +wishes to eliminate the string literals produced by BOOST_CURRENT_FUNCTION from +the final executable for security reasons.

+
+
+
+
+
+ +
+
+
    +
  • +

    Copyright 2002, 2007, 2014, 2017 Peter Dimov

    +
  • +
  • +

    Copyright 2011 Beman Dawes

    +
  • +
  • +

    Copyright 2015 Ion Gaztanaga

    +
  • +
+
+
+

Distributed under the Boost Software License, Version 1.0.

+
+
+
+
+ + + \ No newline at end of file From 30c7c8077a572f39267f1b2d52ffa64ca1211181 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 6 Jun 2017 04:33:44 +0300 Subject: [PATCH 15/22] Remove top-level assert.html and current_function.html --- assert.html | 154 ------------------------------------------ current_function.html | 37 ---------- index.html | 4 +- 3 files changed, 2 insertions(+), 193 deletions(-) delete mode 100644 assert.html delete mode 100644 current_function.html diff --git a/assert.html b/assert.html deleted file mode 100644 index e1c5b4f..0000000 --- a/assert.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - Boost: assert.hpp documentation - - - - - - - - - - - -
boost.png (6897 bytes) - -

assert.hpp

-
 
-

- BOOST_ASSERT
- BOOST_ASSERT_MSG
- BOOST_VERIFY
- BOOST_VERIFY_MSG
- BOOST_ASSERT_IS_VOID
-

- -

BOOST_ASSERT

-

- The header <boost/assert.hpp> defines the macro BOOST_ASSERT, - which is similar to the standard assert macro defined in <cassert>. - The macro is intended to be used in both Boost libraries and user - code. -

-

• By default, BOOST_ASSERT(expr) expands to assert(expr).

-

• If the macro BOOST_DISABLE_ASSERTS is defined when <boost/assert.hpp> - is included, BOOST_ASSERT(expr) expands to ((void)0), regardless of whether - the macro NDEBUG is defined. This allows users to selectively disable BOOST_ASSERT without - affecting the definition of the standard assert.

-

• If the macro BOOST_ENABLE_ASSERT_HANDLER is defined when <boost/assert.hpp> - is included, BOOST_ASSERT(expr) expands to

-
-
(BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
-
-

That is, it evaluates expr and if it's false, calls ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__). - This is true regardless of whether NDEBUG is defined.

-

boost::assertion_failed is declared in <boost/assert.hpp> as

-
-
namespace boost
-{
-  void assertion_failed(char const * expr, char const * function, char const * file, long line);
-}
-
-
-

but it is never defined. The user is expected to supply an appropriate - definition.

-

• If the macro BOOST_ENABLE_ASSERT_DEBUG_HANDLER is defined when <boost/assert.hpp> - is included, BOOST_ASSERT(expr) expands to ((void)0) when NDEBUG is - defined. Otherwise the behavior is as if BOOST_ENABLE_ASSERT_HANDLER has been defined.

-

As is the case with <cassert>, <boost/assert.hpp> - can be included multiple times in a single translation unit. BOOST_ASSERT - will be redefined each time as specified above.

- -

BOOST_ASSERT_MSG

-

- The macro BOOST_ASSERT_MSG is similar to BOOST_ASSERT, but it takes an additional argument, - a character literal, supplying an error message.

-

• By default, BOOST_ASSERT_MSG(expr,msg) expands to assert((expr)&&(msg)).

-

• If the macro BOOST_DISABLE_ASSERTS is defined when <boost/assert.hpp> - is included, BOOST_ASSERT_MSG(expr,msg) expands to ((void)0), regardless of whether - the macro NDEBUG is defined.

-

• If the macro BOOST_ENABLE_ASSERT_HANDLER is defined when <boost/assert.hpp> - is included, BOOST_ASSERT_MSG(expr,msg) expands to

-
-
(BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
-
-

This is true regardless of whether NDEBUG is defined.

-

boost::assertion_failed_msg is declared in <boost/assert.hpp> as

-
-
namespace boost
-{
-  void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line);
-}
-
-
-

but it is never defined. The user is expected to supply an appropriate - definition.

-

• If the macro BOOST_ENABLE_ASSERT_DEBUG_HANDLER is defined when <boost/assert.hpp> - is included, BOOST_ASSERT_MSG(expr) expands to ((void)0) when NDEBUG is - defined. Otherwise the behavior is as if BOOST_ENABLE_ASSERT_HANDLER has been defined.

-

As is the case with <cassert>, <boost/assert.hpp> - can be included multiple times in a single translation unit. BOOST_ASSERT_MSG - will be redefined each time as specified above.

- -

BOOST_VERIFY

-

The macro BOOST_VERIFY has the same behavior as BOOST_ASSERT, except that - the expression that is passed to BOOST_VERIFY is always - evaluated. This is useful when the asserted expression has desirable side - effects; it can also help suppress warnings about unused variables when the - only use of the variable is inside an assertion.

-

• If the macro BOOST_DISABLE_ASSERTS is defined when <boost/assert.hpp> - is included, BOOST_VERIFY(expr) expands to ((void)(expr)).

-

• If the macro BOOST_ENABLE_ASSERT_HANDLER is defined when <boost/assert.hpp> - is included, BOOST_VERIFY(expr) expands to BOOST_ASSERT(expr).

-

• Otherwise, BOOST_VERIFY(expr) expands to ((void)(expr)) when NDEBUG is - defined, to BOOST_ASSERT(expr) when it's not.

-

BOOST_VERIFY_MSG

-

The macro BOOST_VERIFY_MSG is similar to BOOST_VERIFY, with an additional parameter, an error message.

-

• If the macro BOOST_DISABLE_ASSERTS is defined when <boost/assert.hpp> - is included, BOOST_VERIFY_MSG(expr,msg) expands to ((void)(expr)).

-

• If the macro BOOST_ENABLE_ASSERT_HANDLER is defined when <boost/assert.hpp> - is included, BOOST_VERIFY_MSG(expr,msg) expands to BOOST_ASSERT_MSG(expr,msg).

-

• Otherwise, BOOST_VERIFY_MSG(expr,msg) expands to ((void)(expr)) when NDEBUG is - defined, to BOOST_ASSERT_MSG(expr,msg) when it's not.

-
-

-

BOOST_ASSERT_IS_VOID

-

The macro BOOST_ASSERT_IS_VOID is defined when BOOST_ASSERT and BOOST_ASSERT_MSG, are expanded to ((void)0). - This macro is useful to avoid compiling and potentially running code that is only intended to prepare data to be used in the assertion.

-
-
-void MyContainer::erase(iterator i)
-{
-  //Some sanity checks, data must be ordered
-  #ifndef BOOST_ASSERT_IS_VOID
-     if(i != c.begin()){
-        iterator prev = i;
-        --prev;
-        BOOST_ASSERT(*prev < *i);
-     }
-     else if(i != c.end()){
-        iterator next = i;
-        ++next;
-        BOOST_ASSERT(*i < *next);
-     }
-  #endif
-  this->erase_impl(i);
-}
-
-
- - -

• By default, BOOST_ASSERT_IS_VOID is defined if NDEBUG is defined.

-

• If the macro BOOST_DISABLE_ASSERTS is defined BOOST_ASSERT_IS_VOID is always defined.

-

• If the macro BOOST_ENABLE_ASSERT_HANDLER is defined BOOST_ASSERT_IS_VOID is never defined.

-

• If the macro BOOST_ENABLE_ASSERT_DEBUG_HANDLER, then BOOST_ASSERT_IS_VOID is defined when NDEBUG is defined.

-
-

- Copyright © 2002, 2007, 2014 by Peter Dimov.  Copyright © 2011 - by Beman Dawes.  Copyright © 2015 by Ion Gaztanaga. Distributed under the Boost Software - License, Version 1.0. See accompanying file LICENSE_1_0.txt - or copy at http://www.boost.org/LICENSE_1_0.txt.

- - diff --git a/current_function.html b/current_function.html deleted file mode 100644 index f7f6515..0000000 --- a/current_function.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - Boost: current_function.hpp documentation - - - - - - - - - - - -
boost.png (6897 bytes) - -

current_function.hpp

-
 
-

- The header <boost/current_function.hpp> defines a single - macro, BOOST_CURRENT_FUNCTION, similar to the - C99 predefined identifier __func__. -

-

BOOST_CURRENT_FUNCTION expands to a string literal containing - the (fully qualified, if possible) name of the enclosing function. If there is - no enclosing function, the behavior is undefined.

-

Some compilers do not provide a way to obtain the name of the current enclosing - function. On such compilers, BOOST_CURRENT_FUNCTION expands to - "(unknown)".

-
-

- Copyright © 2002 by Peter Dimov. Distributed under the Boost Software License, Version - 1.0. See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt.

- - diff --git a/index.html b/index.html index d59ad22..a3c843e 100644 --- a/index.html +++ b/index.html @@ -1,10 +1,10 @@ - + Automatic redirection failed, please go to -assert.html. +doc/html/assert.html.