Update synposis in <memory> to show move semantics for weak_ptr; add tests for already existing move semantics. Mark LWG issues #2315 (no changes needed), 2316 (move semantics for weak_ptr), 2252 (previous commit) and 2271 (previous commit) as complete.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202931 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2014-03-05 03:12:04 +00:00
parent 8d4ce30c79
commit 23ef151614
6 changed files with 73 additions and 4 deletions

View File

@@ -59,4 +59,20 @@ int main()
}
assert(B::count == 0);
assert(A::count == 0);
{
const std::shared_ptr<A> ps(new A);
std::weak_ptr<A> pA(ps);
{
std::weak_ptr<A> pB;
pB = std::move(pA);
assert(B::count == 1);
assert(A::count == 1);
assert(pB.use_count() == 1);
}
assert(B::count == 1);
assert(A::count == 1);
}
assert(B::count == 0);
assert(A::count == 0);
}