6 virtual void destroy() { }
7 void release() { if (f()) destroy(); }
12 ~shared_count() { if (pi
) pi
->release(); }
13 shared_count(shared_count
& r
) : pi(r
.pi
) { if (pi
) pi
->release(); }
20 Foo
& operator*() { return *ptr
; }
22 shared_count refcount
;
26 Bar(Foo
&, shared_ptr
);