From 03acd30ddae9ea8757ec445df46bc2eaeabbe616 Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Thu, 5 Jun 2014 10:48:21 -0700 Subject: [PATCH 1/3] Simplify index documentation and add author information --- doc/addressof.qbk | 34 +++++++++++++++++- doc/checked_delete.qbk | 16 ++++++++- doc/core.qbk | 57 ----------------------------- doc/enable_if.qbk | 12 +++++-- doc/explicit_operator_bool.qbk | 65 ++++++++++++++++++++++++---------- doc/ignore_unused.qbk | 46 ++++++++++++++++-------- doc/lightweight_test.qbk | 13 ++++++- doc/no_exceptions_support.qbk | 12 ++++++- doc/noncopyable.qbk | 12 ++++++- doc/null_deleter.qbk | 12 ++++++- doc/ref.qbk | 13 ++++++- doc/scoped_enum.qbk | 25 ++++++++++--- doc/swap.qbk | 17 +++++++-- 13 files changed, 229 insertions(+), 105 deletions(-) diff --git a/doc/addressof.qbk b/doc/addressof.qbk index 82f0b06..99e0d45 100644 --- a/doc/addressof.qbk +++ b/doc/addressof.qbk @@ -1,4 +1,14 @@ -[section:addressof Header ] +[section:addressof addressof] + +[section Authors] + +* Brad King +* Douglas Gregor +* Peter Dimov + +[endsect] + +[section Header ] The header `` defines the function template `boost::addressof`. `boost::addressof(x)` returns the @@ -9,3 +19,25 @@ address of `x`. Ordinarily, this address can be obtained by based on ideas from discussion with Doug Gregor. [endsect] + +[section Example] + +`` +#include + +struct useless_type { }; + +class nonaddressable { + useless_type operator&() const; +}; + +void f() { + nonaddressable x; + nonaddressable* xp = boost::addressof(x); + // nonaddressable* xpe = &x; /* error */ +} +`` + +[endsect] + +[endsect] diff --git a/doc/checked_delete.qbk b/doc/checked_delete.qbk index 09a0c74..ffc2c95 100644 --- a/doc/checked_delete.qbk +++ b/doc/checked_delete.qbk @@ -1,4 +1,16 @@ -[section:checked_delete Header ] +[section:checked_delete checked_delete] + +[section Authors] + +* Beman Dawes +* Dave Abrahams +* Vladimir Prus +* Rainer Deyke +* John Maddock + +[endsect] + +[section Overview] The header ** defines two function templates, *checked_delete* and *checked_array_delete*, and two @@ -21,6 +33,8 @@ The supplied function and class templates can be used to prevent these problems, as they require a complete type, and cause a compilation error otherwise. +[endsect] + [section Synopsis] `` diff --git a/doc/core.qbk b/doc/core.qbk index b6e9f4e..0c90773 100644 --- a/doc/core.qbk +++ b/doc/core.qbk @@ -30,63 +30,6 @@ criteria for inclusion is that the utility component be: * not dependent on any other Boost modules except Core itself, Config, Assert, Static Assert, or Predef. -Currently, the Core library contains: - -[table - [[Component][Utilities]] - [ - [[link core.addressof addressof]] - [`boost::addressof`] - ] - [ - [[link core.checked_delete checked_delete]] - [`boost::checked_delete`] - ] - [ - [[link core.enable_if enable_if]] - [`boost::enable_if`] - ] - [ - [[link core.explicit_operator_bool explicit_operator_bool]] - [`BOOST_EXPLICIT_OPERATOR_BOOL, - BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT, - BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL`] - ] - [ - [[link core.ignore_unused ignore_unused]] - [`boost::ignore_unused`] - ] - [ - [[link core.lightweight_test lightweight_test]] - [`BOOST_TEST, BOOST_ERROR, BOOST_TEST_EQ, BOOST_TEST_NE, - BOOST_TEST_THROWS, boost::report_errors`] - ] - [ - [[link core.no_exceptions_support no_exceptions_support]] - [`BOOST_TRY, BOOST_CATCH, BOOST_CATCH_END, BOOST_RETHROW`] - ] - [ - [[link core.noncopyable noncopyable]] - [`boost::noncopyable`] - ] - [ - [[link core.null_deleter null_deleter]] - [`boost::null_deleter`] - ] - [ - [[link core.ref ref]] - [`boost::ref`] - ] - [ - [[link core.scoped_enum scoped_enum]] - [Components for portable declaration of scoped enums.] - ] - [ - [[link core.swap swap]] - [`boost::swap`] - ] -] - [endsect] [include:core addressof.qbk] diff --git a/doc/enable_if.qbk b/doc/enable_if.qbk index 3416513..65a453f 100644 --- a/doc/enable_if.qbk +++ b/doc/enable_if.qbk @@ -1,4 +1,12 @@ -[section:enable_if Header ] +[section:enable_if enable_if] + +[section Authors] + +* Jaakko J\u00E4rvi +* Jeremiah Willcock +* Andrew Lumsdaine + +[endsect] [section Introduction] @@ -13,7 +21,7 @@ be applied to enable class template specializations. Applications of `enable_if` are discussed in length in [link REF1 \[1\]] and [link REF2 \[2\]]. -[section Synopsis] +[section Header ] `` namespace boost { diff --git a/doc/explicit_operator_bool.qbk b/doc/explicit_operator_bool.qbk index 7cd4757..a96d48b 100644 --- a/doc/explicit_operator_bool.qbk +++ b/doc/explicit_operator_bool.qbk @@ -1,4 +1,4 @@ -[section:explicit_operator_bool Header ] +[section:explicit_operator_bool explicit_operator_bool] [/ / Copyright (c) 2013 Andrey Semashev @@ -7,11 +7,27 @@ / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /] +[/===============] +[section Authors] +[/===============] + +* Andrey Semashev + +[endsect] + [/===============] [section Overview] [/===============] -`BOOST_EXPLICIT_OPERATOR_BOOL()`, `BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()` and `BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()` are compatibility helper macros that expand to an explicit conversion operator to `bool`. For compilers not supporting explicit conversion operators introduced in C++11 the macros expand to a conversion operator that implements the [@http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Safe_bool safe bool idiom]. In case if the compiler is not able to handle safe bool idiom well the macros expand to a regular conversion operator to `bool`. +Header `` provides +`BOOST_EXPLICIT_OPERATOR_BOOL()`, `BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()` +and `BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()` compatibility helper macros +that expand to an explicit conversion operator to `bool`. For compilers not +supporting explicit conversion operators introduced in C++11 the macros expand +to a conversion operator that implements the +[@http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Safe_bool safe bool idiom]. +In case if the compiler is not able to handle safe bool idiom well the macros +expand to a regular conversion operator to `bool`. [endsect] @@ -19,27 +35,36 @@ [section Examples] [/===============] -Both macros are intended to be placed within a user's class definition. The generated conversion operators will be implemented in terms of `operator!()` that should be defined by user in this class. In case of `BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()` the generated conversion operator will be declared `constexpr` which requires the corresponding `operator!()` to also be `constexpr`. +Both macros are intended to be placed within a user's class definition. The +generated conversion operators will be implemented in terms of `operator!()` +that should be defined by user in this class. In case of +`BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()` the generated conversion operator +will be declared `constexpr` which requires the corresponding `operator!()` +to also be `constexpr`. - template< typename T > - class my_ptr +`` +template< typename T > +class my_ptr +{ + T* m_p; + +public: + BOOST_EXPLICIT_OPERATOR_BOOL() + + bool operator!() const { - T* m_p; - - public: - BOOST_EXPLICIT_OPERATOR_BOOL() - - bool operator!() const - { - return !m_p; - } - }; + return !m_p; + } +}; +`` Now `my_ptr` can be used in conditional expressions, similarly to a regular pointer: - my_ptr< int > p; - if (p) - std::cout << "true" << std::endl; +`` +my_ptr< int > p; +if (p) + std::cout << "true" << std::endl; +`` [endsect] @@ -47,10 +72,12 @@ Now `my_ptr` can be used in conditional expressions, similarly to a regular poin [section History] [/===============] -[heading boost 1.55] +[section boost 1.55] * The macro was extracted from Boost.Log. [endsect] [endsect] + +[endsect] diff --git a/doc/ignore_unused.qbk b/doc/ignore_unused.qbk index b083c77..64adfd7 100644 --- a/doc/ignore_unused.qbk +++ b/doc/ignore_unused.qbk @@ -1,4 +1,12 @@ -[section:ignore_unused Header ] +[section:ignore_unused ignore_unused] + +[section Authors] + +* Adam Wulkiewicz + +[endsect] + +[section Header ] The header `` defines the function template `boost::ignore_unused()`. It may be used to suppress the "unused variable" or @@ -7,23 +15,33 @@ 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. -`boost::ignore_unused()` was contributed by Adam Wulkiewicz. - Usage - boost::ignore_unused(v1, v2, v3); - boost::ignore_unused(); +`` +boost::ignore_unused(v1, v2, v3); +boost::ignore_unused(); +`` Example - int fun( int foo, int bar ) - { - boost::ignore_unused(bar); - #ifdef ENABLE_DEBUG_OUTPUT - if ( foo < bar ) - std::cerr << "warning! foo < bar"; - #endif - return foo + 2; - } +`` +int fun( int foo, int bar ) +{ + boost::ignore_unused(bar); +#ifdef ENABLE_DEBUG_OUTPUT + if ( foo < bar ) + std::cerr << "warning! foo < bar"; +#endif + return foo + 2; +} +`` + +[endsect] + +[section Acknowledgments] + +`boost::ignore_unused()` was contributed by Adam Wulkiewicz. + +[endsect] [endsect] diff --git a/doc/lightweight_test.qbk b/doc/lightweight_test.qbk index 8f7ce9a..58ad45c 100644 --- a/doc/lightweight_test.qbk +++ b/doc/lightweight_test.qbk @@ -1,4 +1,13 @@ -[section:lightweight_test Header ] +[section:lightweight_test lightweight_test] + +[section Authors] + +* Peter Dimov +* Beman Dawes + +[endsect] + +[section Header ] [section BOOST_TEST] @@ -86,3 +95,5 @@ int main() [endsect] [endsect] + +[endsect] diff --git a/doc/no_exceptions_support.qbk b/doc/no_exceptions_support.qbk index 3c61eef..e9da12f 100644 --- a/doc/no_exceptions_support.qbk +++ b/doc/no_exceptions_support.qbk @@ -1,4 +1,12 @@ -[section:no_exceptions_support Header ] +[section:no_exceptions_support no_exceptions_support] + +[section Authors] + +* Pavel Vozenilek + +[endsect] + +[section Header ] Example of use: @@ -48,3 +56,5 @@ void foo() { `` [endsect] + +[endsect] diff --git a/doc/noncopyable.qbk b/doc/noncopyable.qbk index 8d62de7..d7a5d28 100644 --- a/doc/noncopyable.qbk +++ b/doc/noncopyable.qbk @@ -1,4 +1,12 @@ -[section:noncopyable Header ] +[section:noncopyable noncopyable] + +[section Authors] + +* Dave Abrahams + +[endsect] + +[section Header ] The header `` defines the class `boost::noncopyable`. It is intended to be used as a private @@ -11,3 +19,5 @@ from it inherits these properties. Abrahams. [endsect] + +[endsect] diff --git a/doc/null_deleter.qbk b/doc/null_deleter.qbk index 747ac49..068ff7e 100644 --- a/doc/null_deleter.qbk +++ b/doc/null_deleter.qbk @@ -5,7 +5,15 @@ / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /] -[section:null_deleter Header ] +[section:null_deleter null_deleter] + +[section Authors] + +* Andrey Semashev + +[endsect] + +[section Header ] The header `` defines the `boost::null_deleter` function object, which can be used as a deleter with smart pointers such as `unique_ptr` or `shared_ptr`. The @@ -20,3 +28,5 @@ Example } [endsect] + +[endsect] diff --git a/doc/ref.qbk b/doc/ref.qbk index 777991f..daf9574 100644 --- a/doc/ref.qbk +++ b/doc/ref.qbk @@ -1,4 +1,15 @@ -[section:ref Header ] +[section:ref ref] + +[section Authors] + +* Jaakko J\u00E4rvi +* Peter Dimov +* Douglas Gregor +* Dave Abrahams +* Frank Mori Hess +* Ronald Garcia + +[endsect] [section Introduction] diff --git a/doc/scoped_enum.qbk b/doc/scoped_enum.qbk index d0ef888..64050c4 100644 --- a/doc/scoped_enum.qbk +++ b/doc/scoped_enum.qbk @@ -1,4 +1,13 @@ -[section:scoped_enum Headers , ] +[section:scoped_enum scoped_enum] + +[section Authors] + +* Beman Dawes +* Vicente J. Botet Escriba + +[endsect] + +[section Overview] The `boost/core/scoped_enum.hpp` header contains a number of macros that can be used to generate C++11 scoped enums (7.2 \[dcl.enum\]) if the feature is supported by the compiler, otherwise emulate @@ -96,7 +105,9 @@ Sample usage: sample = algae::green; foo( algae::cyan ); -[heading Deprecated syntax] +[endsect] + +[section Deprecated syntax] In early versions of the header there were two ways to declare scoped enums, with different pros and cons to each. The other way used a different set of macros: @@ -120,7 +131,9 @@ and `BOOST_SCOPED_ENUM` to `BOOST_SCOPED_ENUM_NATIVE`. Note also the semicolon b In the current version these macros produce equivalent result to the ones described above and are considered deprecated. -[heading Acquiring the underlying type of the enum] +[endsect] + +[section Acquiring the underlying type of the enum] The header `boost/core/underlying_type.hpp` defines the metafunction `boost::underlying_type` which can be used to obtain the underlying type of the scoped enum. This metafunction has support for emulated scoped enums declared with @@ -131,7 +144,9 @@ Unfortunately, there are configurations which implement scoped enums but not `st `boost::underlying_type` has to be specialized by user. The macro `BOOST_NO_UNDERLYING_TYPE` is defined to indicate such cases. -[heading Acknowledgements] +[endsect] + +[section Acknowledgments] Thanks to Andrey Semashev for pointing out that emulation through a namespace could not be used within classes. @@ -141,3 +156,5 @@ Joel Falcou, Mathias Gaunard, Felipe Magno de Almeida, Matt Calabrese, Vicente Botet, and Daniel James. [endsect] + +[endsect] diff --git a/doc/swap.qbk b/doc/swap.qbk index 48b2ce4..7d07e88 100644 --- a/doc/swap.qbk +++ b/doc/swap.qbk @@ -1,7 +1,20 @@ -[section:swap Header ] +[section:swap swap] + +[section Authors] + +* Niels Dekker +* Joseph Gauterin +* Steven Watanabe +* Eric Niebler + +[endsect] + +[section Header ] `template void swap(T& left, T& right);` - + +[endsect] + [section Introduction] The template function `boost::swap` allows the values of two From 692f98d3f3e3a655dfed80c5f62ca7adfbb530aa Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 5 Jun 2014 22:47:32 +0400 Subject: [PATCH 2/3] Updated Acknowledgements section. --- doc/scoped_enum.qbk | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/scoped_enum.qbk b/doc/scoped_enum.qbk index 64050c4..3bb036a 100644 --- a/doc/scoped_enum.qbk +++ b/doc/scoped_enum.qbk @@ -148,12 +148,10 @@ such cases. [section Acknowledgments] -Thanks to Andrey Semashev for pointing out that emulation through a namespace -could not be used within classes. +This scoped enum emulation was developed by Beman Dawes, Vicente J. Botet Escriba and Anthony Williams. -Helpful comments and suggestions were also made by Kjell Elster, Phil Endecott, -Joel Falcou, Mathias Gaunard, Felipe Magno de Almeida, Matt Calabrese, Vicente -Botet, and Daniel James. +Helpful comments and suggestions were also made by Kjell Elster, Phil Endecott, Joel Falcou, Mathias Gaunard, Felipe Magno de Almeida, +Matt Calabrese, Daniel James and Andrey Semashev. [endsect] From 066709db0cdafefdfd11b3588ed3f1979154eee7 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 5 Jun 2014 23:04:06 +0400 Subject: [PATCH 3/3] Updated History section. --- doc/explicit_operator_bool.qbk | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/doc/explicit_operator_bool.qbk b/doc/explicit_operator_bool.qbk index a96d48b..419b1ec 100644 --- a/doc/explicit_operator_bool.qbk +++ b/doc/explicit_operator_bool.qbk @@ -7,9 +7,9 @@ / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /] -[/===============] +[/==============] [section Authors] -[/===============] +[/==============] * Andrey Semashev @@ -68,16 +68,19 @@ if (p) [endsect] -[/===============] +[/==============] [section History] -[/===============] +[/==============] -[section boost 1.55] +[heading boost 1.56] + +* Added new macros `BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT` and `BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL` to define `noexcept` and `constexpr` operators. +* The header moved to Boost.Core. + +[heading boost 1.55] * The macro was extracted from Boost.Log. [endsect] [endsect] - -[endsect]