diff --git a/doc/smart_ptr/allocate_unique.adoc b/doc/smart_ptr/allocate_unique.adoc index 10d14f4..b144e59 100644 --- a/doc/smart_ptr/allocate_unique.adoc +++ b/doc/smart_ptr/allocate_unique.adoc @@ -35,6 +35,12 @@ library to use an allocator for the creation of the objects managed by [subs=+quotes] ``` namespace boost { + template + class alloc_deleter; + + template + using alloc_noinit_deleter = alloc_deleter>; + `// T is not an array` template std::unique_ptr> @@ -262,3 +268,53 @@ Constraints:: `T` is an array of known bounds. Returns:: A `std::unique_ptr` to a sequence of `extent_v` default-initialized objects of type `remove_extent_t`. Example:: `auto p = allocate_unique_noinit(a);` + +## Deleter + +Class template `alloc_deleter` is the deleter used by the `allocate_unique` +functions. + +### Synopsis + +[subs=+quotes] +``` +namespace boost { + template + class alloc_deleter { + public: + using pointer = `unspecified`; + + explicit alloc_deleter(const A& a) noexcept; + + void operator()(pointer p); + }; +} +``` + +### Members + +[subs=+quotes] +``` +using pointer = `unspecified`; +``` +[none] +* {blank} ++ +A type that satisfies _NullablePointer_. + +``` +explicit alloc_deleter(const A& a) noexcept; +``` +[none] +* {blank} ++ +Effects:: Initializes the stored allocator from `a`. + +``` +void operator()(pointer p); +``` +[none] +* {blank} ++ +Effects:: Destroys the objects and deallocates the storage referenced by `p`, +using the stored allocator.