From 5b08a8a43254ed30bd953e869b0fd9fc1e8b82d0 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Tue, 11 May 2010 21:36:01 +0000 Subject: Wiped out some non-ascii characters that snuck into the copyright. llvm-svn: 103516 --- .../util.smartptr.weak/util.smartptr.weak.obs/lock.pass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/lock.pass.cpp') diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/lock.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/lock.pass.cpp index fc7e338e6b7..c68792058fc 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/lock.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/lock.pass.cpp @@ -1 +1 @@ -//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // shared_ptr lock() const; #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::weak_ptr wp; std::shared_ptr sp = wp.lock(); assert(sp.use_count() == 0); assert(sp.get() == 0); assert(A::count == 0); } { std::shared_ptr sp0(new A); std::weak_ptr wp(sp0); std::shared_ptr sp = wp.lock(); assert(sp.use_count() == 2); assert(sp.get() == sp0.get()); assert(A::count == 1); } assert(A::count == 0); { std::shared_ptr sp0(new A); std::weak_ptr wp(sp0); sp0.reset(); std::shared_ptr sp = wp.lock(); assert(sp.use_count() == 0); assert(sp.get() == 0); assert(A::count == 0); } assert(A::count == 0); } \ No newline at end of file +//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // weak_ptr // shared_ptr lock() const; #include #include struct A { static int count; A() {++count;} A(const A&) {++count;} ~A() {--count;} }; int A::count = 0; int main() { { std::weak_ptr wp; std::shared_ptr sp = wp.lock(); assert(sp.use_count() == 0); assert(sp.get() == 0); assert(A::count == 0); } { std::shared_ptr sp0(new A); std::weak_ptr wp(sp0); std::shared_ptr sp = wp.lock(); assert(sp.use_count() == 2); assert(sp.get() == sp0.get()); assert(A::count == 1); } assert(A::count == 0); { std::shared_ptr sp0(new A); std::weak_ptr wp(sp0); sp0.reset(); std::shared_ptr sp = wp.lock(); assert(sp.use_count() == 0); assert(sp.get() == 0); assert(A::count == 0); } assert(A::count == 0); } \ No newline at end of file -- cgit v1.2.3