Skip to content

Commit ce530f5

Browse files
committed
Improve C++ conformance chapter adding mention to uses-allocator related utilities
1 parent 7a22ae2 commit ce530f5

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

doc/container.qbk

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -937,11 +937,11 @@ Use them simply specifying the new allocator in the corresponding template argum
937937

938938
[endsect]
939939

940-
[section:cpp_conformance C++11/C++14/C++17 Conformance]
940+
[section:cpp_conformance C++ Conformance]
941941

942942
[*Boost.Container] aims for full C++11 conformance except reasoned deviations,
943943
backporting as much as possible for C++03. Obviously, this conformance is a work
944-
in progress so this section explains what C++11/C++14/C++17 features are implemented and which
944+
in progress so this section explains what C++ features are implemented and which
945945
of them have been backported to earlier standard conformig compilers.
946946

947947
[section:move_emplace Move and Emplace]
@@ -958,7 +958,7 @@ a finite number of parameters.
958958

959959
[endsect]
960960

961-
[section:alloc_traits_move_traits Stateful allocators]
961+
[section:stateful_allocators Stateful allocators and uses-allocator protocol]
962962

963963
C++03 was not stateful-allocator friendly. For compactness of container objects and for
964964
simplicity, it did not require containers to support allocators with state: Allocator objects
@@ -968,8 +968,9 @@ to suppose two allocators of the same type always compare equal (that means that
968968
by one allocator object could be deallocated by another instance of the same type) and
969969
allocators were not swapped when the container was swapped.
970970

971-
C++11 further improves stateful allocator support through
972-
[@http://en.cppreference.com/w/cpp/memory/allocator_traits `std::allocator_traits`].
971+
C++11 further improves stateful allocator support through:
972+
973+
* [@http://en.cppreference.com/w/cpp/memory/allocator_traits `std::allocator_traits`].
973974
`std::allocator_traits` is the protocol between a container and an allocator, and
974975
an allocator writer can customize its behaviour (should the container propagate it in
975976
move constructor, swap, etc.?) following `allocator_traits` requirements. [*Boost.Container]
@@ -979,7 +980,15 @@ C++17 changes. This class
979980
offers some workarounds for C++03 compilers to achieve the same allocator guarantees as
980981
`std::allocator_traits`.
981982

982-
In [Boost.Container] containers, if possible, a single allocator is hold to construct
983+
* [@https://en.cppreference.com/w/cpp/memory/uses_allocator.html `The uses-allocator protocol`]
984+
allows types to declare they can work with allocators, even when constructed through intermediary
985+
code that doesn't know about them. [*Boost.Container] implements the trait
986+
[classref boost::container::uses_allocator uses_allocator] and also implements utilities inspired
987+
by C++20's additions:
988+
[funcref boost::container::uninitialized_construct_using_allocator uninitialized_construct_using_allocator]
989+
and [funcref boost::container::make_obj_using_allocator make_obj_using_allocator].
990+
991+
Additionally, in [*Boost.Container] containers, if possible, a single allocator is hold to construct
983992
`value_type`s. If the container needs an auxiliary
984993
allocator (e.g. an array allocator used by `deque` or `stable_vector`), that allocator is also
985994
stored in the container and initialized from the user-supplied allocator when the

0 commit comments

Comments
 (0)