//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <memory>
// shared_ptr
// void reset();
#include<memory>#include<cassert>structB{staticintcount;B(){++count;}B(constB&){++count;}virtual~B(){--count;}};intB::count=0;structA:publicB{staticintcount;A(){++count;}A(constA&){++count;}~A(){--count;}};intA::count=0;intmain(){{std::shared_ptr<B>p(newB);p.reset();assert(A::count==0);assert(B::count==0);assert(p.use_count()==0);assert(p.get()==0);}assert(A::count==0);{std::shared_ptr<B>p;p.reset();assert(A::count==0);assert(B::count==0);assert(p.use_count()==0);assert(p.get()==0);}assert(A::count==0);}