From 14fb9e443344e9ac2a9d1751dbe054e97b5893e3 Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Fri, 3 May 2019 21:20:34 -0400 Subject: [PATCH] More documentation updates --- doc/alloc_construct.qbk | 15 ++++++++------- doc/default_allocator.qbk | 13 +++++++++++++ doc/noinit_adaptor.qbk | 8 ++++++++ 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/doc/alloc_construct.qbk b/doc/alloc_construct.qbk index ba83a97..5e2d9c7 100644 --- a/doc/alloc_construct.qbk +++ b/doc/alloc_construct.qbk @@ -82,7 +82,7 @@ std::size_t n);`] [[variablelist [[Requires][`A` is an /Allocator/]] [[Effects] -[Destroys each /i/th element in reverse order by calling +[Destroys each ['i]th element in reverse order by calling `std::allocator_traits::destroy(a, &p[i])`.]]]]] [[`template void alloc_construct(A& a, T* p, U&&... u);`] @@ -95,20 +95,20 @@ std::size_t n);`] [[variablelist [[Requires][`A` is an /Allocator/]] [[Effects] -[Constructs each /i/th element in order by calling +[Constructs each ['i]th element in order by calling `std::allocator_traits::construct(a, &p[i])`.]] [[Remarks] -[If an exception is thrown, destroys each already constructed /j/th element in +[If an exception is thrown destroys each already constructed ['j]th element in reverse order by calling `std::allocator_traits::destroy(a, &p[j])`.]]]]] [[`template void alloc_construct_n(A& a, T* p, std::size_t n, const T* l, std::size_t m);`] [[variablelist [[Requires][`A` is an /Allocator/]] [[Effects] -[Constructs each /i/th element in order by calling +[Constructs each ['i]th element in order by calling `std::allocator_traits::construct(a, &p[i], l[i % m])`.]] [[Remarks] -[If an exception is thrown, destroys each already constructed /j/th element in +[If an exception is thrown destroys each already constructed ['j]th element in reverse order by calling `std::allocator_traits::destroy(a, &p[j])`.]]]]]] [endsect] @@ -117,8 +117,9 @@ reverse order by calling `std::allocator_traits::destroy(a, &p[j])`.]]]]]] [section Acknowledgments] -Glen Fernandes originally implemented this functionality in Boost.Smart_ptr and -later moved these functions to Boost.Core for use in multiple Boost libraries. +Glen Fernandes originally implemented this functionality in Boost.Smart_Ptr and +later moved these functions to Boost.Core for use in other Boost libraries, +such as Boost.Multi_Array. [endsect] diff --git a/doc/default_allocator.qbk b/doc/default_allocator.qbk index 74fa427..7df2781 100644 --- a/doc/default_allocator.qbk +++ b/doc/default_allocator.qbk @@ -38,6 +38,19 @@ template, class FlatSet; ``` +Facilities like `make_shared` can be implemented using `allocate_shared` with +`default_allocator`. + +``` +template +enable_if_t, shared_ptr > +make_shared(Args&&... args) +{ + return allocate_shared(boost::default_allocator >(), + std::forward(args)...); +} +``` + [endsect] [section Reference] diff --git a/doc/noinit_adaptor.qbk b/doc/noinit_adaptor.qbk index 24edd26..4ff265e 100644 --- a/doc/noinit_adaptor.qbk +++ b/doc/noinit_adaptor.qbk @@ -169,4 +169,12 @@ const noinit_adaptor& rhs) noexcept;`] [endsect] +[section Compatibility] + +When `BOOST_NO_CXX11_ALLOCATOR` is defined, and the C++11 allocator model is +not supported, these functions invoke constructors and destructors directly +without going through the supplied allocator. + +[endsect] + [endsect]