get_shared_ptr renamed to weak_ptr::lock.

[SVN r17307]
This commit is contained in:
Peter Dimov
2003-02-10 15:56:36 +00:00
parent 34f423f811
commit 851d87a1bb
7 changed files with 69 additions and 73 deletions
+5 -5
View File
@@ -94,7 +94,7 @@ template<class T> void test_is_Y(boost::shared_ptr<T> const & p)
template<class T> void test_is_Y(boost::weak_ptr<T> const & p)
{
boost::shared_ptr<T> q = boost::get_shared_ptr(p);
boost::shared_ptr<T> q = p.lock();
BOOST_TEST(q.get() != 0);
BOOST_TEST(q->id() == 2);
}
@@ -221,7 +221,7 @@ int main()
{
}
test_is_zero(boost::get_shared_ptr(wp1));
test_is_zero(wp1.lock());
weak_ptr<X> wp2 = static_pointer_cast<X>(p5);
@@ -232,10 +232,10 @@ int main()
// Scoped to not affect the subsequent use_count() tests.
{
shared_ptr<X> sp2(wp2);
test_is_nonzero(boost::get_shared_ptr(wp2));
test_is_nonzero(wp2.lock());
}
weak_ptr<Y> wp3 = dynamic_pointer_cast<Y>(boost::get_shared_ptr(wp2));
weak_ptr<Y> wp3 = dynamic_pointer_cast<Y>(wp2.lock());
BOOST_TEST(wp3.use_count() == 1);
test_shared(wp2, wp3);
@@ -246,7 +246,7 @@ int main()
test_shared(wp2, wp4);
wp1 = p2;
test_is_zero(boost::get_shared_ptr(wp1));
test_is_zero(wp1.lock());
wp1 = p4;
wp1 = wp3;
+1 -1
View File
@@ -3094,7 +3094,7 @@ public:
virtual boost::shared_ptr<X> getX()
{
boost::shared_ptr<X> px = boost::get_shared_ptr(weak_this);
boost::shared_ptr<X> px = weak_this.lock();
return px;
}
};
+3 -3
View File
@@ -1183,14 +1183,14 @@ void test()
} // namespace n_comparison
namespace n_get_shared_ptr
namespace n_lock
{
void test()
{
}
} // namespace n_get_shared_ptr
} // namespace n_lock
namespace n_map
{
@@ -1272,7 +1272,7 @@ int main()
n_use_count::test();
n_swap::test();
n_comparison::test();
n_get_shared_ptr::test();
n_lock::test();
n_map::test();