forked from boostorg/smart_ptr
Bug fixes.
[SVN r12787]
This commit is contained in:
@@ -135,12 +135,12 @@ public:
|
|||||||
|
|
||||||
operator bool_type() const // never throws
|
operator bool_type() const // never throws
|
||||||
{
|
{
|
||||||
return use_count() == 0? 0: &this_type::use_count;
|
return px == 0 || use_count() == 0? 0: &this_type::use_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator! () const // never throws
|
bool operator! () const // never throws
|
||||||
{
|
{
|
||||||
return use_count() == 0;
|
return px == 0 || use_count() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void swap(this_type & other) // never throws
|
void swap(this_type & other) // never throws
|
||||||
|
@@ -249,6 +249,8 @@ int test_main(int, char * [])
|
|||||||
test_eq(wp2, wp4);
|
test_eq(wp2, wp4);
|
||||||
|
|
||||||
wp1 = p2;
|
wp1 = p2;
|
||||||
|
test_is_zero(wp1);
|
||||||
|
|
||||||
wp1 = p4;
|
wp1 = p4;
|
||||||
wp1 = wp3;
|
wp1 = wp3;
|
||||||
wp1 = wp2;
|
wp1 = wp2;
|
||||||
|
Reference in New Issue
Block a user