forked from boostorg/smart_ptr
Add _add_ref and _release overload documentation
This commit is contained in:
@@ -60,6 +60,14 @@ namespace boost {
|
|||||||
protected:
|
protected:
|
||||||
~intrusive_ref_counter() = default;
|
~intrusive_ref_counter() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<class Derived, class CounterPolicy>
|
||||||
|
void intrusive_ptr_add_ref(
|
||||||
|
const intrusive_ref_counter<Derived, CounterPolicy>* p) noexcept;
|
||||||
|
|
||||||
|
template<class Derived, class CounterPolicy>
|
||||||
|
void intrusive_ptr_release(
|
||||||
|
const intrusive_ref_counter<Derived, CounterPolicy>* p) noexcept;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -99,7 +107,7 @@ intrusive_ref_counter& operator=(const intrusive_ref_counter& v) noexcept;
|
|||||||
```
|
```
|
||||||
::
|
::
|
||||||
Effects::: Does nothing, reference counter is not modified.
|
Effects::: Does nothing, reference counter is not modified.
|
||||||
|
y
|
||||||
### use_count
|
### use_count
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -109,3 +117,26 @@ unsigned int use_count() const noexcept;
|
|||||||
Returns::: The current value of the reference counter.
|
Returns::: The current value of the reference counter.
|
||||||
|
|
||||||
NOTE: The returned value may not be actual in multi-threaded applications.
|
NOTE: The returned value may not be actual in multi-threaded applications.
|
||||||
|
|
||||||
|
## Free Functions
|
||||||
|
|
||||||
|
### intrusive_ptr_add_ref
|
||||||
|
|
||||||
|
```
|
||||||
|
template<class Derived, class CounterPolicy>
|
||||||
|
void intrusive_ptr_add_ref(
|
||||||
|
const intrusive_ref_counter<Derived, CounterPolicy>* p) noexcept;
|
||||||
|
```
|
||||||
|
::
|
||||||
|
Effects::: Increments the reference counter.
|
||||||
|
|
||||||
|
### intrusive_ptr_release
|
||||||
|
|
||||||
|
```
|
||||||
|
template<class Derived, class CounterPolicy>
|
||||||
|
void intrusive_ptr_release(
|
||||||
|
const intrusive_ref_counter<Derived, CounterPolicy>* p) noexcept;
|
||||||
|
```
|
||||||
|
::
|
||||||
|
Effects::: Decrements the reference counter. If the reference counter reaches
|
||||||
|
0, calls `delete static_cast<const Derived*>(p)`.
|
||||||
|
Reference in New Issue
Block a user