mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-10-11 06:55:25 +02:00
weak_ptr::expired() added; weak_ptr documentation updated.
[SVN r13141]
This commit is contained in:
@@ -97,7 +97,7 @@ public:
|
||||
|
||||
T * get() const // never throws; unsafe in multithreaded programs!
|
||||
{
|
||||
return use_count() == 0? 0: px;
|
||||
return pn.use_count() == 0? 0: px;
|
||||
}
|
||||
|
||||
long use_count() const // never throws
|
||||
@@ -105,6 +105,11 @@ public:
|
||||
return pn.use_count();
|
||||
}
|
||||
|
||||
bool expired() const // never throws
|
||||
{
|
||||
return pn.use_count() == 0;
|
||||
}
|
||||
|
||||
void swap(this_type & other) // never throws
|
||||
{
|
||||
std::swap(px, other.px);
|
||||
|
Reference in New Issue
Block a user