From 6db55f7dfdf8dc671390dc57b19aa85775806c5b Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Thu, 15 Jun 2017 11:33:06 -0400 Subject: [PATCH] Add _add_ref and _release overload documentation --- doc/smart_ptr/intrusive_ref_counter.adoc | 33 +++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/doc/smart_ptr/intrusive_ref_counter.adoc b/doc/smart_ptr/intrusive_ref_counter.adoc index 091f9cd..1d33300 100644 --- a/doc/smart_ptr/intrusive_ref_counter.adoc +++ b/doc/smart_ptr/intrusive_ref_counter.adoc @@ -60,6 +60,14 @@ namespace boost { protected: ~intrusive_ref_counter() = default; }; + + template + void intrusive_ptr_add_ref( + const intrusive_ref_counter* p) noexcept; + + template + void intrusive_ptr_release( + const intrusive_ref_counter* p) noexcept; } ``` @@ -99,7 +107,7 @@ intrusive_ref_counter& operator=(const intrusive_ref_counter& v) noexcept; ``` :: Effects::: Does nothing, reference counter is not modified. - +y ### use_count ``` @@ -109,3 +117,26 @@ unsigned int use_count() const noexcept; Returns::: The current value of the reference counter. NOTE: The returned value may not be actual in multi-threaded applications. + +## Free Functions + +### intrusive_ptr_add_ref + +``` +template + void intrusive_ptr_add_ref( + const intrusive_ref_counter* p) noexcept; +``` +:: +Effects::: Increments the reference counter. + +### intrusive_ptr_release + +``` +template + void intrusive_ptr_release( + const intrusive_ref_counter* p) noexcept; +``` +:: +Effects::: Decrements the reference counter. If the reference counter reaches +0, calls `delete static_cast(p)`.