mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-09-27 00:01:05 +02:00
Update documentation of intrusive_ptr (document move ops, fix op<)
This commit is contained in:
@@ -54,12 +54,18 @@ namespace boost {
|
|||||||
intrusive_ptr(intrusive_ptr const & r);
|
intrusive_ptr(intrusive_ptr const & r);
|
||||||
template<class Y> intrusive_ptr(intrusive_ptr<Y> const & r);
|
template<class Y> intrusive_ptr(intrusive_ptr<Y> const & r);
|
||||||
|
|
||||||
|
intrusive_ptr(intrusive_ptr && r);
|
||||||
|
template<class Y> intrusive_ptr(intrusive_ptr<Y> && r);
|
||||||
|
|
||||||
~intrusive_ptr();
|
~intrusive_ptr();
|
||||||
|
|
||||||
intrusive_ptr & operator=(intrusive_ptr const & r);
|
intrusive_ptr & operator=(intrusive_ptr const & r);
|
||||||
template<class Y> intrusive_ptr & operator=(intrusive_ptr<Y> const & r);
|
template<class Y> intrusive_ptr & operator=(intrusive_ptr<Y> const & r);
|
||||||
intrusive_ptr & operator=(T * r);
|
intrusive_ptr & operator=(T * r);
|
||||||
|
|
||||||
|
intrusive_ptr & operator=(intrusive_ptr && r);
|
||||||
|
template<class Y> intrusive_ptr & operator=(intrusive_ptr<Y> && r);
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
void reset(T * r);
|
void reset(T * r);
|
||||||
void reset(T * r, bool add_ref);
|
void reset(T * r, bool add_ref);
|
||||||
@@ -92,8 +98,8 @@ namespace boost {
|
|||||||
template<class T, class U>
|
template<class T, class U>
|
||||||
bool operator!=(T * a, intrusive_ptr<U> const & b) noexcept;
|
bool operator!=(T * a, intrusive_ptr<U> const & b) noexcept;
|
||||||
|
|
||||||
template<class T, class U>
|
template<class T>
|
||||||
bool operator<(intrusive_ptr<T> const & a, intrusive_ptr<U> const & b) noexcept;
|
bool operator<(intrusive_ptr<T> const & a, intrusive_ptr<T> const & b) noexcept;
|
||||||
|
|
||||||
template<class T> void swap(intrusive_ptr<T> & a, intrusive_ptr<T> & b) noexcept;
|
template<class T> void swap(intrusive_ptr<T> & a, intrusive_ptr<T> & b) noexcept;
|
||||||
|
|
||||||
@@ -158,6 +164,18 @@ template<class Y> intrusive_ptr(intrusive_ptr<Y> const & r);
|
|||||||
Effects:: `T * p = r.get(); if(p != 0) intrusive_ptr_add_ref(p);`.
|
Effects:: `T * p = r.get(); if(p != 0) intrusive_ptr_add_ref(p);`.
|
||||||
Postconditions:: `get() == r.get()`.
|
Postconditions:: `get() == r.get()`.
|
||||||
|
|
||||||
|
```
|
||||||
|
intrusive_ptr(intrusive_ptr && r);
|
||||||
|
```
|
||||||
|
```
|
||||||
|
template<class Y> intrusive_ptr(intrusive_ptr<Y> && r);
|
||||||
|
```
|
||||||
|
|
||||||
|
[none]
|
||||||
|
* {blank}
|
||||||
|
+
|
||||||
|
Postconditions:: `get()` equals the old value of `r.get()`. `r.get() == 0`.
|
||||||
|
|
||||||
### destructor
|
### destructor
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -187,6 +205,19 @@ intrusive_ptr & operator=(T * r);
|
|||||||
Effects:: Equivalent to `intrusive_ptr(r).swap(*this)`.
|
Effects:: Equivalent to `intrusive_ptr(r).swap(*this)`.
|
||||||
Returns:: `*this`.
|
Returns:: `*this`.
|
||||||
|
|
||||||
|
```
|
||||||
|
intrusive_ptr & operator=(intrusive_ptr && r);
|
||||||
|
```
|
||||||
|
```
|
||||||
|
template<class Y> intrusive_ptr & operator=(intrusive_ptr<Y> && r);
|
||||||
|
```
|
||||||
|
|
||||||
|
[none]
|
||||||
|
* {blank}
|
||||||
|
+
|
||||||
|
Effects:: Equivalent to `intrusive_ptr(std::move(r)).swap(*this)`.
|
||||||
|
Returns:: `*this`.
|
||||||
|
|
||||||
### reset
|
### reset
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -361,8 +392,8 @@ template<class T, class U>
|
|||||||
Returns:: `a != b.get()`.
|
Returns:: `a != b.get()`.
|
||||||
|
|
||||||
```
|
```
|
||||||
template<class T, class U>
|
template<class T>
|
||||||
bool operator<(intrusive_ptr<T> const & a, intrusive_ptr<U> const & b) noexcept;
|
bool operator<(intrusive_ptr<T> const & a, intrusive_ptr<T> const & b) noexcept;
|
||||||
```
|
```
|
||||||
|
|
||||||
[none]
|
[none]
|
||||||
|
Reference in New Issue
Block a user