diff --git a/doc/addressof.qbk b/doc/addressof.qbk index 99e0d45..4de845d 100644 --- a/doc/addressof.qbk +++ b/doc/addressof.qbk @@ -1,3 +1,12 @@ +[/ + Copyright 2014 Peter Dimov + + Distributed under the Boost Software License, Version 1.0. + + See accompanying file LICENSE_1_0.txt + or copy at http://boost.org/LICENSE_1_0.txt +] + [section:addressof addressof] [section Authors] @@ -18,6 +27,15 @@ address of `x`. Ordinarily, this address can be obtained by `boost::addressof` was originally contributed by Brad King based on ideas from discussion with Doug Gregor. +[section Synopsis] + +`` +namespace boost +{ + template T* addressof( T& x ); +} +`` + [endsect] [section Example] @@ -41,3 +59,5 @@ void f() { [endsect] [endsect] + +[endsect] diff --git a/doc/checked_delete.qbk b/doc/checked_delete.qbk index ffc2c95..cb00ad3 100644 --- a/doc/checked_delete.qbk +++ b/doc/checked_delete.qbk @@ -12,9 +12,9 @@ [section Overview] -The header ** defines two function -templates, *checked_delete* and *checked_array_delete*, and two -class templates, *checked_deleter* and *checked_array_deleter*. +The header `` defines two function +templates, `checked_delete` and `checked_array_delete`, and two +class templates, `checked_deleter` and `checked_array_deleter`. The C++ Standard allows, in 5.3.5/5, pointers to incomplete class types to be deleted with a delete-expression. When the @@ -25,7 +25,7 @@ unfortunately, not all do, and programmers sometimes ignore or disable warnings. A particularly troublesome case is when a smart pointer's -destructor, such as *boost::scoped_ptr::~scoped_ptr*, is +destructor, such as `boost::scoped_ptr::~scoped_ptr`, is instantiated with an incomplete type. This can often lead to silent, hard to track failures. @@ -53,7 +53,7 @@ namespace boost [section template void checked_delete(T * p);] -* *Requires:* *T* must be a complete type. The expression +* *Requires:* `T` must be a complete type. The expression `delete p` must be well-formed. * *Effects:* `delete p;` @@ -65,7 +65,7 @@ namespace boost [section template void checked_array_delete(T * p);] -* *Requires:* *T* must be a complete type. The expression +* *Requires:* `T` must be a complete type. The expression `delete [] p` must be well-formed. * *Effects:* `delete [] p;` @@ -117,9 +117,9 @@ template struct checked_array_deleter [section Acknowledgements] -The function templates *checked_delete* and -*checked_array_delete* were originally part of -**, and the documentation +The function templates `checked_delete` and +`checked_array_delete` were originally part of +``, and the documentation acknowledged Beman Dawes, Dave Abrahams, Vladimir Prus, Rainer Deyke, John Maddock, and others as contributors. diff --git a/doc/ignore_unused.qbk b/doc/ignore_unused.qbk index 64adfd7..991c9a5 100644 --- a/doc/ignore_unused.qbk +++ b/doc/ignore_unused.qbk @@ -1,3 +1,12 @@ +[/ + Copyright 2014 Adam Wulkiewicz + + Distributed under the Boost Software License, Version 1.0. + + See accompanying file LICENSE_1_0.txt + or copy at http://boost.org/LICENSE_1_0.txt +] + [section:ignore_unused ignore_unused] [section Authors] @@ -15,14 +24,16 @@ can't be removed or commented out, e.g. when some blocks of the code are conditionally activated. C++11 variadic templates are used if they're supported, otherwise they're emulated with overloads. -Usage +[section Usage] `` boost::ignore_unused(v1, v2, v3); boost::ignore_unused(); `` -Example +[endsect] + +[section Example] `` int fun( int foo, int bar ) @@ -38,6 +49,8 @@ int fun( int foo, int bar ) [endsect] +[endsect] + [section Acknowledgments] `boost::ignore_unused()` was contributed by Adam Wulkiewicz. diff --git a/doc/lightweight_test.qbk b/doc/lightweight_test.qbk index 58ad45c..a840906 100644 --- a/doc/lightweight_test.qbk +++ b/doc/lightweight_test.qbk @@ -1,3 +1,14 @@ +[/ + Copyright 2010, 2011 Beman Dawes + Copyright 2013 Ion Gaztanaga + Copyright 2014 Peter Dimov + + Distributed under the Boost Software License, Version 1.0. + + See accompanying file LICENSE_1_0.txt + or copy at http://boost.org/LICENSE_1_0.txt +] + [section:lightweight_test lightweight_test] [section Authors] @@ -9,6 +20,31 @@ [section Header ] +The header `` is a +lightweight test framework. It's useful for writing +Boost regression tests for components that are dependencies +of Boost.Test. + +When using `lightweight_test.hpp`, *do not forget* to +`return boost::report_errors()` from `main`. + +[section Synopsis] + +`` +#define BOOST_TEST(expression) /*unspecified*/ +#define BOOST_ERROR(message) /*unspecified*/ +#define BOOST_TEST_EQ(expr1, expr2) /*unspecified*/ +#define BOOST_TEST_NE(expr1, expr2) /*unspecified*/ +#define BOOST_TEST_THROWS(expr, excep) /*unspecified*/ + +namespace boost +{ + int report_errors(); +} +`` + +[endsect] + [section BOOST_TEST] `` @@ -37,7 +73,7 @@ Increases error count and outputs a message containing BOOST_TEST_EQ(expr1, expr2) `` -If `expr1` != `expr2` increases the error count and outputs a +If `expr1 != expr2` increases the error count and outputs a message containing both expressions. [endsect] @@ -48,7 +84,7 @@ message containing both expressions. BOOST_TEST_NE(expr1, expr2) `` -If `expr1` == `expr2` increases the error count and outputs a +If `expr1 == expr2` increases the error count and outputs a message containing both expressions. [endsect] @@ -59,11 +95,11 @@ message containing both expressions. BOOST_TEST_THROWS(expr, excep) `` -If BOOST_NO_EXCEPTIONS is NOT defined and if `expr` does not +If `BOOST_NO_EXCEPTIONS` is *not* defined and if `expr` does not throw an exception of type `excep`, increases the error count and outputs a message containing the expression. -If BOOST_NO_EXCEPTIONS is defined, this macro expands to +If `BOOST_NO_EXCEPTIONS` is defined, this macro expands to nothing and `expr` is not evaluated. [endsect] @@ -76,19 +112,84 @@ int boost::report_errors() Return the error count from `main`. -Example: +[endsect] + +[section Example] `` #include -void sqr( int x ); // should return x * x +int sqr( int x ); // should return x * x int main() { - BOOST_TEST( sqr( 2 ) == 4 ); - BOOST_TEST_EQ( sqr(-3), 9 ); + BOOST_TEST( sqr(2) == 4 ); + BOOST_TEST_EQ( sqr(-3), 9 ); - return boost::report_errors(); + return boost::report_errors(); +} +`` + +[endsect] + +[endsect] + +[section Header ] + +The header `` defines +a couple of extra macros for testing compile-time traits that +return a boolean value. + +[section Synopsis] + +`` +#define BOOST_TEST_TRAIT_TRUE((Trait)) /*unspecified*/ +#define BOOST_TEST_TRAIT_FALSE((Trait)) /*unspecified*/ +`` + +[endsect] + +[section BOOST_TEST_TRAIT_TRUE] + +`` +BOOST_TEST_TRAIT_TRUE((Trait)) +`` + +If `Trait::value != true` increases the error count and outputs a +message containing `Trait`. Note the double set of parentheses; these +enable `Trait` to contain a comma, which is common for templates. + +[endsect] + +[section BOOST_TEST_TRAIT_FALSE] + +`` +BOOST_TEST_TRAIT_FALSE((Trait)) +`` + +If `Trait::value != false` increases the error count and outputs a +message containing `Trait`. Note the double set of parentheses. + +[endsect] + +[section Example] + +`` +#include +#include + +template struct X +{ + typedef T type; +} + +using boost::core::is_same; + +int main() +{ + BOOST_TEST_TRAIT_TRUE(( is_same::type, int> )); + + return boost::report_errors(); } `` diff --git a/doc/no_exceptions_support.qbk b/doc/no_exceptions_support.qbk index e9da12f..ecc3073 100644 --- a/doc/no_exceptions_support.qbk +++ b/doc/no_exceptions_support.qbk @@ -1,3 +1,13 @@ +[/ + Copyright 2004 Pavel Vozenilek + Copyright 2014 Peter Dimov + + Distributed under the Boost Software License, Version 1.0. + + See accompanying file LICENSE_1_0.txt + or copy at http://boost.org/LICENSE_1_0.txt +] + [section:no_exceptions_support no_exceptions_support] [section Authors] @@ -8,7 +18,22 @@ [section Header ] -Example of use: +The header `` defines +macros for use in code that needs to be portable to environments +that do not have support for C++ exceptions. + +[section Synopsis] + +`` +#define BOOST_TRY /*unspecified*/ +#define BOOST_CATCH(x) /*unspecified*/ +#define BOOST_CATCH_END /*unspecified*/ +#define BOOST_RETHROW /*unspecified*/ +`` + +[endsect] + +[section Example Use] `` void foo() { @@ -58,3 +83,5 @@ void foo() { [endsect] [endsect] + +[endsect] diff --git a/doc/noncopyable.qbk b/doc/noncopyable.qbk index d7a5d28..3ad9bf8 100644 --- a/doc/noncopyable.qbk +++ b/doc/noncopyable.qbk @@ -1,3 +1,13 @@ +[/ + Copyright 1999-2003 Beman Dawes + Copyright 2014 Peter Dimov + + Distributed under the Boost Software License, Version 1.0. + + See accompanying file LICENSE_1_0.txt + or copy at http://boost.org/LICENSE_1_0.txt +] + [section:noncopyable noncopyable] [section Authors] @@ -18,6 +28,29 @@ from it inherits these properties. `boost::noncopyable` was originally contributed by Dave Abrahams. +[section Synopsis] + +`` +namespace boost +{ + class noncopyable; +} +`` + +[endsect] + +[section Example] + +`` +#include + +class X: private boost::noncopyable +{ +}; +`` + +[endsect] + [endsect] [endsect]