mirror of
https://github.com/boostorg/smart_ptr.git
synced 2026-05-19 23:34:42 +02:00
get_shared_ptr renamed to weak_ptr::lock.
[SVN r17307]
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user