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)`.